how to execute a command at the startup [Solved]
how to execute a command at the startup
i try to use /usr/bin/xmodmap $HOME/.Xmodmap command at the startup
i use xfce
it's a way to make f8 and f9 capable to increase and lower the speakers
i use xfce
it's a way to make f8 and f9 capable to increase and lower the speakers
Re: how to execute a command at the startup
i tried just to add the command at /etc/rc.local, above the exit 0 line
but the file don;t seem to be executed
but the file don;t seem to be executed
Re: how to execute a command at the startup
The .Xmodmap will already take effect, do you have the required lines in it correctly? Like
Or.. what's the command exactly? (Assuming it works from a terminal).
Code: Select all
keycode 218 = blahblah
Re: how to execute a command at the startup
$ cat .Xmodmap
keycode 74 = XF86AudioLowerVolume
keycode 75 = XF86AudioRaiseVolume
/usr/bin/xmodmap $HOME/.Xmodmap works fine from a terminal
keycode 74 = XF86AudioLowerVolume
keycode 75 = XF86AudioRaiseVolume
/usr/bin/xmodmap $HOME/.Xmodmap works fine from a terminal
Re: how to execute a command at the startup
"Session and Startup" - "App Autostart" tab, add new, any name, any description, command:
(Add 2 new items)
If still not working we'll add some delay.
Or just:
/usr/bin/xmodmap /home/yourusername/.Xmodmap
as the command (particularly "the full path" as above , not $HOME or ~/... )
Code: Select all
sh -c "/usr/bin/xmodmap -e 'keycode 74=XF86AudioLowerVolume'"
Code: Select all
sh -c "/usr/bin/xmodmap -e 'keycode 75=XF86AudioRaiseVolume'"
If still not working we'll add some delay.
Or just:
/usr/bin/xmodmap /home/yourusername/.Xmodmap
as the command (particularly "the full path" as above , not $HOME or ~/... )
Re: how to execute a command at the startup
it is not working. let's add some delay. how?
Re: how to execute a command at the startup [Solved]
Code: Select all
sh -c 'sleep 5 ; /usr/bin/xmodmap /home/yourusername/.Xmodmap'
Code: Select all
sh -c "sleep 5 ; /usr/bin/xmodmap -e 'keycode 74=XF86AudioLowerVolume'"
Code: Select all
sh -c "sleep 5 ; /usr/bin/xmodmap -e 'keycode 75=XF86AudioRaiseVolume'"
Re: how to execute a command at the startup
it is working. (i had to restart the system also.)
Ty so much
Ty so much

Re: how to execute a command at the startup
You're welcome :)
Which one did you use? The path or the commands?
Btw. maybe you mark the thread solved :)
Which one did you use? The path or the commands?
Btw. maybe you mark the thread solved :)
Re: how to execute a command at the startup
xmodmap will be reset when setxkbmap is running.wax wrote: Sat May 11, 2024 1:04 pm $ cat .Xmodmap
keycode 74 = XF86AudioLowerVolume
keycode 75 = XF86AudioRaiseVolume
/usr/bin/xmodmap $HOME/.Xmodmap works fine from a terminal
So you may need to delay b/c in session/autostart and somewhere in X-startup a setxkbmap is triggered.
Alternatively rename the autostart entry to something like
zz_xmodmap
which genrates a desktop file within:
$HOME/.config/zz_xmodmap.desktop
So it will run last within the list of entries, which are executed in order.