summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2022-07-19 11:41:26 +0300
committerSyndamia <kamen@syndamia.com>2022-07-19 11:41:26 +0300
commit68429f7bd64fbb01c18984aaf51e081c6da9422b (patch)
tree49d67f2026c55375b37542642e6a9b958f565be3
parentfdcd93a83cc66b2b475b76beb5f87e50e0483e9f (diff)
downloaddotfiles-68429f7bd64fbb01c18984aaf51e081c6da9422b.tar
dotfiles-68429f7bd64fbb01c18984aaf51e081c6da9422b.tar.gz
dotfiles-68429f7bd64fbb01c18984aaf51e081c6da9422b.zip
Moved autostart commands to a seperate script
-rw-r--r--.config/openbox/autostart42
-rwxr-xr-xscripts/system/on-wm-session.sh43
2 files changed, 44 insertions, 41 deletions
diff --git a/.config/openbox/autostart b/.config/openbox/autostart
index bd74ffd..aa90170 100644
--- a/.config/openbox/autostart
+++ b/.config/openbox/autostart
@@ -2,44 +2,4 @@
# These commands are ran when an Openbox X Session is started.
#
-device="desktop"
-
-# xhost +si:localuser:root # fixes unable to open display errors: https://askubuntu.com/a/1130413
-~/.fehbg & # wallpaper
-# lead & # hot corners, this is MageJohn's fork: https://github.com/MageJohn/lead
-xcape -e 'Super_L=Super_L|P' & # used for the "windows" menu
-sleep 1 && /usr/libexec/polkit-gnome-authentication-agent-1 &
-
-dunst & # notification daemon
-lxpolkit & # polkit
-xautolock -detectsleep -secure -time 15 -locker ~/.i3lock/lock.sh & # auto lock screen
-tint2 & # taskbar
-picom & # compositor
-setxkbmap -layout "us,bg" -variant ",phonetic" -option "grp:alt_shift_toggle" & # keyboard switching
-
-if [[ $device == "desktop" ]]; then
- xset m 1 1 # disable mouse acceleration (not a very proper way to do it, I know)
-fi
-
-if [[ $device == "laptop" ]]; then
- while :; do if grep -Fq "closed" /proc/acpi/button/lid/LID0/state; then ~/.i3lock/lock.sh suspend && sleep 3; fi; sleep 0.5; done & # lock screen on lid closing; you'll also need to uncomment the HandleLidSwitch variable and assign to it "lock" (HandleLidSwitch=lock) inside /etc/systemd/logind.conf
- libinput-gestures-setup start & # start gestures
- blueberry & # bluetooth app
-fi
-
-pnmixer & # volume applet
-nm-applet & # network applet
-~/scripts/dunst-toggler-applet.sh & # notification toggler
-devilspie2 & # updates windows icons to the ones form the current theme
-
-flameshot & # screenshot utility
-redshift-gtk & # screen color temperature changer
-copyq & # clipboard manager
-barrier & # share mouse and keyboard between devices
-nextcloud & # cloud/source control
-
-electron-mail &
-rambox &
-gtk-launch discord &
-brave-bin &
-claws-mail &
+~/scripts/system/on-wm-session.sh
diff --git a/scripts/system/on-wm-session.sh b/scripts/system/on-wm-session.sh
new file mode 100755
index 0000000..85b7999
--- /dev/null
+++ b/scripts/system/on-wm-session.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+device="laptop"
+
+# xhost +si:localuser:root # fixes unable to open display errors: https://askubuntu.com/a/1130413
+~/.fehbg & # wallpaper
+# lead & # hot corners, this is MageJohn's fork: https://github.com/MageJohn/lead
+xcape -e 'Super_L=Super_L|P' & # used for the "windows" menu
+sleep 1 && /usr/libexec/polkit-gnome-authentication-agent-1 &
+
+dunst & # notification daemon
+lxpolkit & # polkit
+xautolock -detectsleep -secure -time 15 -locker ~/.i3lock/lock.sh & # auto lock screen
+tint2 & # taskbar
+picom & # compositor
+setxkbmap -layout "us,bg" -variant ",phonetic" -option "grp:alt_shift_toggle" & # keyboard switching
+
+if [[ $device == "desktop" ]]; then
+ xset m 1 1 # disable mouse acceleration (not a very proper way to do it, I know)
+fi
+
+if [[ $device == "laptop" ]]; then
+ while :; do if grep -Fq "closed" /proc/acpi/button/lid/LID0/state; then ~/.i3lock/lock.sh suspend && sleep 3; fi; sleep 0.5; done & # lock screen on lid closing; you'll also need to uncomment the HandleLidSwitch variable and assign to it "lock" (HandleLidSwitch=lock) inside /etc/systemd/logind.conf
+ libinput-gestures-setup start & # start gestures
+ blueberry & # bluetooth app
+fi
+
+pnmixer & # volume applet
+nm-applet & # network applet
+~/scripts/dunst-toggler-applet.sh & # notification toggler
+devilspie2 & # updates windows icons to the ones form the current theme
+
+flameshot & # screenshot utility
+redshift-gtk & # screen color temperature changer
+copyq & # clipboard manager
+barrier & # share mouse and keyboard between devices
+nextcloud & # cloud/source control
+
+electron-mail &
+rambox &
+gtk-launch discord &
+brave-bin &
+claws-mail &