.xsession exec not recognise $HOME or arguments?












0















The basic scenario is that I'm sharing my dot files across multiple machines and want to have my session definitons synced as well.



Since I use different laptops and monitors with significantly different DPIs I want to be able to manually specify the desired DPI for each session.



After a few ugly(s/y/ier/g) hacks I settled on the .xsession running a wrapper script instead of directly calling xmonad-start (or gnome-session or whatever), and passing the desired DPI to that wrapper script. Like so:



/usr/share/.xsessions/xmonad-standard.xsession



[Desktop Entry]
Name=Xmonad
Exec=/home/itsamemario/.xmonad/xmonad-start


/usr/share/.xsessions/xmonad-hidpi.xsession



[Desktop Entry]
Name=Xmonad HiDPI
Exec=/home/itsamemario/.xmonad/xmonad-start 192


/home/itsamemario/.xmonad/xmonad-start



#!/bin/sh

xrdb -merge "$HOME/.Xresources"

# For setting DPI by passing an argument from display manager
if [ ! -z "$1" ]; then
TMPFILE=$(mktemp)
echo "! Fonts {{{
Xft.dpi: $1
! }}}" > "$TMPFILE"
xrdb -merge "$TMPFILE"
notify-send "Setting DPI to $1"
rm -f "$TMPFILE"
fi

# Other unimportant stuff here

exec /usr/bin/xmonad


Everything works great on two installs, but on the third one I can't run any session except the default one with no arguments passed. I just get the following error in .xsession-errors and it drops back to lightdm:



/etc/lightdm/Xsession: line 76: /home/itsamemario/.xmonad/xmonad-start 192: No such file or directory


In the course of debugging I've also noticed that I can also normally use $HOME/.xmonad/xmonad-start and .xmonad/xmonad-start on the other two installs but on this one it only works if I explicitly include /home/itsamemario/. All three are running Arch and I can't see any relevant difference in how they were installed or configured.



What could be causing exec lines in .xsessions to not pass arguments properly, and possibly also not expand session variables like $HOME?



(I know there are better workarounds to the DPI issue but my wrapper script approach addresses other requirements. I'm just focusing on DPI only here for the sake of simplicity.)










share|improve this question




















  • 1





    Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

    – Chris Stryczynski
    Apr 16 '18 at 7:18
















0















The basic scenario is that I'm sharing my dot files across multiple machines and want to have my session definitons synced as well.



Since I use different laptops and monitors with significantly different DPIs I want to be able to manually specify the desired DPI for each session.



After a few ugly(s/y/ier/g) hacks I settled on the .xsession running a wrapper script instead of directly calling xmonad-start (or gnome-session or whatever), and passing the desired DPI to that wrapper script. Like so:



/usr/share/.xsessions/xmonad-standard.xsession



[Desktop Entry]
Name=Xmonad
Exec=/home/itsamemario/.xmonad/xmonad-start


/usr/share/.xsessions/xmonad-hidpi.xsession



[Desktop Entry]
Name=Xmonad HiDPI
Exec=/home/itsamemario/.xmonad/xmonad-start 192


/home/itsamemario/.xmonad/xmonad-start



#!/bin/sh

xrdb -merge "$HOME/.Xresources"

# For setting DPI by passing an argument from display manager
if [ ! -z "$1" ]; then
TMPFILE=$(mktemp)
echo "! Fonts {{{
Xft.dpi: $1
! }}}" > "$TMPFILE"
xrdb -merge "$TMPFILE"
notify-send "Setting DPI to $1"
rm -f "$TMPFILE"
fi

# Other unimportant stuff here

exec /usr/bin/xmonad


Everything works great on two installs, but on the third one I can't run any session except the default one with no arguments passed. I just get the following error in .xsession-errors and it drops back to lightdm:



/etc/lightdm/Xsession: line 76: /home/itsamemario/.xmonad/xmonad-start 192: No such file or directory


In the course of debugging I've also noticed that I can also normally use $HOME/.xmonad/xmonad-start and .xmonad/xmonad-start on the other two installs but on this one it only works if I explicitly include /home/itsamemario/. All three are running Arch and I can't see any relevant difference in how they were installed or configured.



What could be causing exec lines in .xsessions to not pass arguments properly, and possibly also not expand session variables like $HOME?



(I know there are better workarounds to the DPI issue but my wrapper script approach addresses other requirements. I'm just focusing on DPI only here for the sake of simplicity.)










share|improve this question




















  • 1





    Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

    – Chris Stryczynski
    Apr 16 '18 at 7:18














0












0








0








The basic scenario is that I'm sharing my dot files across multiple machines and want to have my session definitons synced as well.



Since I use different laptops and monitors with significantly different DPIs I want to be able to manually specify the desired DPI for each session.



After a few ugly(s/y/ier/g) hacks I settled on the .xsession running a wrapper script instead of directly calling xmonad-start (or gnome-session or whatever), and passing the desired DPI to that wrapper script. Like so:



/usr/share/.xsessions/xmonad-standard.xsession



[Desktop Entry]
Name=Xmonad
Exec=/home/itsamemario/.xmonad/xmonad-start


/usr/share/.xsessions/xmonad-hidpi.xsession



[Desktop Entry]
Name=Xmonad HiDPI
Exec=/home/itsamemario/.xmonad/xmonad-start 192


/home/itsamemario/.xmonad/xmonad-start



#!/bin/sh

xrdb -merge "$HOME/.Xresources"

# For setting DPI by passing an argument from display manager
if [ ! -z "$1" ]; then
TMPFILE=$(mktemp)
echo "! Fonts {{{
Xft.dpi: $1
! }}}" > "$TMPFILE"
xrdb -merge "$TMPFILE"
notify-send "Setting DPI to $1"
rm -f "$TMPFILE"
fi

# Other unimportant stuff here

exec /usr/bin/xmonad


Everything works great on two installs, but on the third one I can't run any session except the default one with no arguments passed. I just get the following error in .xsession-errors and it drops back to lightdm:



/etc/lightdm/Xsession: line 76: /home/itsamemario/.xmonad/xmonad-start 192: No such file or directory


In the course of debugging I've also noticed that I can also normally use $HOME/.xmonad/xmonad-start and .xmonad/xmonad-start on the other two installs but on this one it only works if I explicitly include /home/itsamemario/. All three are running Arch and I can't see any relevant difference in how they were installed or configured.



What could be causing exec lines in .xsessions to not pass arguments properly, and possibly also not expand session variables like $HOME?



(I know there are better workarounds to the DPI issue but my wrapper script approach addresses other requirements. I'm just focusing on DPI only here for the sake of simplicity.)










share|improve this question
















The basic scenario is that I'm sharing my dot files across multiple machines and want to have my session definitons synced as well.



Since I use different laptops and monitors with significantly different DPIs I want to be able to manually specify the desired DPI for each session.



After a few ugly(s/y/ier/g) hacks I settled on the .xsession running a wrapper script instead of directly calling xmonad-start (or gnome-session or whatever), and passing the desired DPI to that wrapper script. Like so:



/usr/share/.xsessions/xmonad-standard.xsession



[Desktop Entry]
Name=Xmonad
Exec=/home/itsamemario/.xmonad/xmonad-start


/usr/share/.xsessions/xmonad-hidpi.xsession



[Desktop Entry]
Name=Xmonad HiDPI
Exec=/home/itsamemario/.xmonad/xmonad-start 192


/home/itsamemario/.xmonad/xmonad-start



#!/bin/sh

xrdb -merge "$HOME/.Xresources"

# For setting DPI by passing an argument from display manager
if [ ! -z "$1" ]; then
TMPFILE=$(mktemp)
echo "! Fonts {{{
Xft.dpi: $1
! }}}" > "$TMPFILE"
xrdb -merge "$TMPFILE"
notify-send "Setting DPI to $1"
rm -f "$TMPFILE"
fi

# Other unimportant stuff here

exec /usr/bin/xmonad


Everything works great on two installs, but on the third one I can't run any session except the default one with no arguments passed. I just get the following error in .xsession-errors and it drops back to lightdm:



/etc/lightdm/Xsession: line 76: /home/itsamemario/.xmonad/xmonad-start 192: No such file or directory


In the course of debugging I've also noticed that I can also normally use $HOME/.xmonad/xmonad-start and .xmonad/xmonad-start on the other two installs but on this one it only works if I explicitly include /home/itsamemario/. All three are running Arch and I can't see any relevant difference in how they were installed or configured.



What could be causing exec lines in .xsessions to not pass arguments properly, and possibly also not expand session variables like $HOME?



(I know there are better workarounds to the DPI issue but my wrapper script approach addresses other requirements. I'm just focusing on DPI only here for the sake of simplicity.)







session xmonad lightdm x






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 31 '18 at 19:50









jasonwryan

50k14134188




50k14134188










asked Mar 31 '18 at 1:58









nathancherenathanchere

17115




17115








  • 1





    Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

    – Chris Stryczynski
    Apr 16 '18 at 7:18














  • 1





    Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

    – Chris Stryczynski
    Apr 16 '18 at 7:18








1




1





Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

– Chris Stryczynski
Apr 16 '18 at 7:18





Maybe using bash and it's debug + error mode - set -x and set -e might be a way to further diagnose this.

– Chris Stryczynski
Apr 16 '18 at 7:18










1 Answer
1






active

oldest

votes


















1














Excerpt from https://help.gnome.org/admin/system-admin-guide/stable/session-custom.html.en



On Debian change the following in /etc/X11/Xsession.d/20x11-common_process-args




Change STARTUP_FULL_PATH=$(/usr/bin/which "$1"|| true) to STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)



Change STARTUP="$1" to STARTUP=$1







share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434605%2fxsession-exec-not-recognise-home-or-arguments%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Excerpt from https://help.gnome.org/admin/system-admin-guide/stable/session-custom.html.en



    On Debian change the following in /etc/X11/Xsession.d/20x11-common_process-args




    Change STARTUP_FULL_PATH=$(/usr/bin/which "$1"|| true) to STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)



    Change STARTUP="$1" to STARTUP=$1







    share|improve this answer




























      1














      Excerpt from https://help.gnome.org/admin/system-admin-guide/stable/session-custom.html.en



      On Debian change the following in /etc/X11/Xsession.d/20x11-common_process-args




      Change STARTUP_FULL_PATH=$(/usr/bin/which "$1"|| true) to STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)



      Change STARTUP="$1" to STARTUP=$1







      share|improve this answer


























        1












        1








        1







        Excerpt from https://help.gnome.org/admin/system-admin-guide/stable/session-custom.html.en



        On Debian change the following in /etc/X11/Xsession.d/20x11-common_process-args




        Change STARTUP_FULL_PATH=$(/usr/bin/which "$1"|| true) to STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)



        Change STARTUP="$1" to STARTUP=$1







        share|improve this answer













        Excerpt from https://help.gnome.org/admin/system-admin-guide/stable/session-custom.html.en



        On Debian change the following in /etc/X11/Xsession.d/20x11-common_process-args




        Change STARTUP_FULL_PATH=$(/usr/bin/which "$1"|| true) to STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)



        Change STARTUP="$1" to STARTUP=$1








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 1 at 12:17









        PaulPaul

        111




        111






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434605%2fxsession-exec-not-recognise-home-or-arguments%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀