Where should I put a bash script if I want it to be executed once during X startup as part of system bootup. For example, I want to start up VPN on my machine as root user once X starts up.
When X initializes (lets say GDM in my case) or when a user logs in using a DM (desktop manager) is it considered a login shell?
Also I would like to run programs as long as I am logged in using X. For example, I want to run Dropbox as long as I am logged in using Gnome.
Anything you want to run when a user logs into an X session, you want to put in the
.xsession file in the user's
This page has a pretty good explanation:
You should put them in
.xinitrc . This is mine :
#!/bin/zsh #Map Capslock to ESC setxkbmap -option caps:escape & #Wallpaper feh --bg-scale /mnt/data/Dropbox/pic/character/samurai.png #turn off beep sound xset -b #mouse speed xset m 1/5 #keyboard repeat speed xset r rate 200 30 #font xset +fp /usr/share/fonts/local xset fp rehash #urxvtd daemon urxvtd -q -f -o & #Disable touchpad tapping and scrolling when typing syndaemon -t -i 2 & #Hide cursor unclutter -keystroke & #Redshift - change your screen temp to reduce eyestrain redshift & # Dropbox dropboxd & #dwm status while true do xsetroot -name "nXqd" sleep 20s done & #Window manager exec dwm