.xsession exec not recognise $HOME or arguments?
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
add a comment |
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
1
Maybe using bash and it's debug + error mode -set -x
andset -e
might be a way to further diagnose this.
– Chris Stryczynski
Apr 16 '18 at 7:18
add a comment |
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
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
session xmonad lightdm x
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
andset -e
might be a way to further diagnose this.
– Chris Stryczynski
Apr 16 '18 at 7:18
add a comment |
1
Maybe using bash and it's debug + error mode -set -x
andset -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
add a comment |
1 Answer
1
active
oldest
votes
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)
toSTARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
Change
STARTUP="$1"
toSTARTUP=$1
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
toSTARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
Change
STARTUP="$1"
toSTARTUP=$1
add a comment |
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)
toSTARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
Change
STARTUP="$1"
toSTARTUP=$1
add a comment |
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)
toSTARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
Change
STARTUP="$1"
toSTARTUP=$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)
toSTARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
Change
STARTUP="$1"
toSTARTUP=$1
answered Feb 1 at 12:17
PaulPaul
111
111
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Maybe using bash and it's debug + error mode -
set -x
andset -e
might be a way to further diagnose this.– Chris Stryczynski
Apr 16 '18 at 7:18