Use $HOME env var instead of hardcoded paths

- Replace home directory paths with $HOME env var
- Add sleeps to winitrc so it waits for dwl to start
This commit is contained in:
Sravan Balaji 2024-09-29 15:13:54 -04:00
parent a5938074a9
commit 4c4daeab26
11 changed files with 74 additions and 70 deletions

View File

@ -3022,11 +3022,11 @@ See [[https://github.com/phillipberndt/autorandr#hook-scripts][autorandr hook sc
if ! pgrep -x "i3lock" > /dev/null if ! pgrep -x "i3lock" > /dev/null
then then
# Restart session # Restart session
/home/sravan/.scripts/session.sh --restart & $HOME/.scripts/session.sh --restart &
fi fi
# Disable & Re-Enable Compositor # Disable & Re-Enable Compositor
/home/sravan/.scripts/picom.sh --on & $HOME/.scripts/picom.sh --on &
# NVIDIA Force Composition Pipeline # NVIDIA Force Composition Pipeline
/usr/bin/nvidia-force-comp-pipeline & /usr/bin/nvidia-force-comp-pipeline &
@ -3036,7 +3036,7 @@ fi
# Update lock screen wallpaper # Update lock screen wallpaper
/usr/bin/betterlockscreen -u \ /usr/bin/betterlockscreen -u \
/home/sravan/Data/NextCloud/Wallpapers/Desktop/Solar_System.png & $HOME/Data/NextCloud/Wallpapers/Desktop/Solar_System.png &
#+END_SRC #+END_SRC
*** Compositor *** Compositor
@ -3561,7 +3561,7 @@ main() {
pkill picom pkill picom
fi fi
picom --config /home/sravan/.config/picom/picom.conf -b picom --config $HOME/.config/picom/picom.conf -b
notify-send "Turning Picom ON" notify-send "Turning Picom ON"
;; ;;
@ -3786,7 +3786,7 @@ bgcolor=282a36ff
#+BEGIN_SRC conf :tangle betterlockscreen/.config/betterlockscreen/betterlockscreenrc #+BEGIN_SRC conf :tangle betterlockscreen/.config/betterlockscreen/betterlockscreenrc
prelock() { prelock() {
/home/sravan/.scripts/dunst.sh --pause $HOME/.scripts/dunst.sh --pause
} }
#+END_SRC #+END_SRC
@ -3795,7 +3795,7 @@ prelock() {
#+BEGIN_SRC conf :tangle betterlockscreen/.config/betterlockscreen/betterlockscreenrc #+BEGIN_SRC conf :tangle betterlockscreen/.config/betterlockscreen/betterlockscreenrc
# custom postlock # custom postlock
postlock() { postlock() {
/home/sravan/.scripts/dunst.sh --unpause $HOME/.scripts/dunst.sh --unpause
} }
#+END_SRC #+END_SRC
@ -7533,13 +7533,13 @@ These are scripts that should be run from Lutris when launching or exiting a gam
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle gaming/.scripts/game_launch.sh #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle gaming/.scripts/game_launch.sh
if [ $XDG_SESSION_DESKTOP == "dwm" ]; then if [ $XDG_SESSION_DESKTOP == "dwm" ]; then
/home/sravan/.scripts/picom.sh --off & $HOME/.scripts/picom.sh --off &
/usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true & /usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true &
fi fi
/home/sravan/.scripts/cpu-gpu.sh --cpu-profile-performance & $HOME/.scripts/cpu-gpu.sh --cpu-profile-performance &
/home/sravan/.scripts/cpu-gpu.sh --gpu-profile-performance & $HOME/.scripts/cpu-gpu.sh --gpu-profile-performance &
/home/sravan/.scripts/dunst.sh --pause & $HOME/.scripts/dunst.sh --pause &
#+END_SRC #+END_SRC
*** Post-Exit Script *** Post-Exit Script
@ -7548,13 +7548,13 @@ fi
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle gaming/.scripts/game_exit.sh #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle gaming/.scripts/game_exit.sh
if [ $XDG_SESSION_DESKTOP == "dwm" ]; then if [ $XDG_SESSION_DESKTOP == "dwm" ]; then
/home/sravan/.scripts/picom.sh --on & $HOME/.scripts/picom.sh --on &
/usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false & /usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false &
fi fi
/home/sravan/.scripts/dunst.sh --unpause & $HOME/.scripts/dunst.sh --unpause &
/home/sravan/.scripts/cpu-gpu.sh --cpu-profile-balanced & $HOME/.scripts/cpu-gpu.sh --cpu-profile-balanced &
/home/sravan/.scripts/cpu-gpu.sh --gpu-profile-adaptive & $HOME/.scripts/cpu-gpu.sh --gpu-profile-adaptive &
#+END_SRC #+END_SRC
*** PlayStation 5 (DualSense) to Xbox 360 Controller Button Mapping *** PlayStation 5 (DualSense) to Xbox 360 Controller Button Mapping
@ -8714,13 +8714,13 @@ xrdb ~/.Xresources
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwm/.xinitrc #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwm/.xinitrc
# Startup Applications # Startup Applications
/home/sravan/.scripts/x11-startup.sh --kill-startup && $HOME/.scripts/x11-startup.sh --kill-startup &&
/home/sravan/.scripts/x11-startup.sh --startup $HOME/.scripts/x11-startup.sh --startup
# Delayed Startup Applications # Delayed Startup Applications
(sleep 5 && (sleep 5 &&
/home/sravan/.scripts/x11-startup.sh --kill-delay && $HOME/.scripts/x11-startup.sh --kill-delay &&
/home/sravan/.scripts/x11-startup.sh --delay) & $HOME/.scripts/x11-startup.sh --delay) &
#+END_SRC #+END_SRC
**** Launch Environment **** Launch Environment
@ -8904,8 +8904,8 @@ declare -a delay_array=(\
"/usr/bin/syncthing-gtk" \ # Syncthing GTK "/usr/bin/syncthing-gtk" \ # Syncthing GTK
"/usr/bin/nextcloud" \ # NextCloud Client "/usr/bin/nextcloud" \ # NextCloud Client
"/usr/bin/nyrna" \ # Nyrna "/usr/bin/nyrna" \ # Nyrna
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "bash $HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor "bash $HOME/.scripts/picom.sh --on" \ # Picom Compositor
"/usr/bin/autorandr --change --force" \ # Auto restore screen layout "/usr/bin/autorandr --change --force" \ # Auto restore screen layout
"/usr/bin/numlockx on" \ # Enable numlock "/usr/bin/numlockx on" \ # Enable numlock
) )
@ -8922,8 +8922,8 @@ declare -a kill_delay_array=(\
"pkill syncthing-gtk" \ # Syncthing GTK "pkill syncthing-gtk" \ # Syncthing GTK
"pkill nextcloud" \ # NextCloud Client "pkill nextcloud" \ # NextCloud Client
"pkill nyrna" \ # Nyrna "pkill nyrna" \ # Nyrna
"bash /home/sravan/.scripts/dunst.sh --off" \ # Dunst Notification Daemon "bash $HOME/.scripts/dunst.sh --off" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --off" \ # Picom Compositor "bash $HOME/.scripts/picom.sh --off" \ # Picom Compositor
) )
help_menu() { help_menu() {
@ -9046,8 +9046,10 @@ dwl &
**** Startup Applications & Processes **** Startup Applications & Processes
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.winitrc #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle dwl/.winitrc
/home/sravan/.scripts/wayland-startup.sh --kill-startup && (sleep 3 &&
/home/sravan/.scripts/wayland-startup.sh --startup $HOME/.scripts/wayland-startup.sh --kill-startup &&
sleep 2 &&
$HOME/.scripts/wayland-startup.sh --startup) &
#+END_SRC #+END_SRC
*** Wayland Startup *** Wayland Startup
@ -9783,13 +9785,13 @@ main() {
help_menu help_menu
;; ;;
--dualsense-to-xbox-360) --dualsense-to-xbox-360)
kitty --hold /home/sravan/.scripts/dualsense_to_xbox_360_controller.sh kitty --hold $HOME/.scripts/dualsense_to_xbox_360_controller.sh
;; ;;
--game-launch) --game-launch)
/home/sravan/.scripts/game_launch.sh $HOME/.scripts/game_launch.sh
;; ;;
--game-exit) --game-exit)
/home/sravan/.scripts/game_exit.sh $HOME/.scripts/game_exit.sh
;; ;;
--rofi) --rofi)
rofi_menu rofi_menu
@ -9926,28 +9928,28 @@ main() {
help_menu help_menu
;; ;;
--brightness) --brightness)
/home/sravan/.scripts/brightness.sh --rofi $HOME/.scripts/brightness.sh --rofi
;; ;;
--dunst) --dunst)
/home/sravan/.scripts/dunst.sh --rofi $HOME/.scripts/dunst.sh --rofi
;; ;;
--playerctl) --playerctl)
/home/sravan/.scripts/playerctl.sh --rofi $HOME/.scripts/playerctl.sh --rofi
;; ;;
--pactl) --pactl)
/home/sravan/.scripts/pactl.sh --rofi $HOME/.scripts/pactl.sh --rofi
;; ;;
--backup) --backup)
/home/sravan/.scripts/backup.sh --rofi $HOME/.scripts/backup.sh --rofi
;; ;;
--cpu-gpu) --cpu-gpu)
/home/sravan/.scripts/cpu-gpu.sh --rofi $HOME/.scripts/cpu-gpu.sh --rofi
;; ;;
--gaming) --gaming)
/home/sravan/.scripts/gaming.sh --rofi $HOME/.scripts/gaming.sh --rofi
;; ;;
--session) --session)
/home/sravan/.scripts/session.sh --rofi $HOME/.scripts/session.sh --rofi
;; ;;
--rofi) --rofi)
rofi_menu rofi_menu

View File

@ -3,11 +3,11 @@
if ! pgrep -x "i3lock" > /dev/null if ! pgrep -x "i3lock" > /dev/null
then then
# Restart session # Restart session
/home/sravan/.scripts/session.sh --restart & $HOME/.scripts/session.sh --restart &
fi fi
# Disable & Re-Enable Compositor # Disable & Re-Enable Compositor
/home/sravan/.scripts/picom.sh --on & $HOME/.scripts/picom.sh --on &
# NVIDIA Force Composition Pipeline # NVIDIA Force Composition Pipeline
/usr/bin/nvidia-force-comp-pipeline & /usr/bin/nvidia-force-comp-pipeline &
@ -17,4 +17,4 @@ fi
# Update lock screen wallpaper # Update lock screen wallpaper
/usr/bin/betterlockscreen -u \ /usr/bin/betterlockscreen -u \
/home/sravan/Data/NextCloud/Wallpapers/Desktop/Solar_System.png & $HOME/Data/NextCloud/Wallpapers/Desktop/Solar_System.png &

View File

@ -32,10 +32,10 @@ modifcolor=ff5555ff
bgcolor=282a36ff bgcolor=282a36ff
prelock() { prelock() {
/home/sravan/.scripts/dunst.sh --pause $HOME/.scripts/dunst.sh --pause
} }
# custom postlock # custom postlock
postlock() { postlock() {
/home/sravan/.scripts/dunst.sh --unpause $HOME/.scripts/dunst.sh --unpause
} }

View File

@ -43,28 +43,28 @@ main() {
help_menu help_menu
;; ;;
--brightness) --brightness)
/home/sravan/.scripts/brightness.sh --rofi $HOME/.scripts/brightness.sh --rofi
;; ;;
--dunst) --dunst)
/home/sravan/.scripts/dunst.sh --rofi $HOME/.scripts/dunst.sh --rofi
;; ;;
--playerctl) --playerctl)
/home/sravan/.scripts/playerctl.sh --rofi $HOME/.scripts/playerctl.sh --rofi
;; ;;
--pactl) --pactl)
/home/sravan/.scripts/pactl.sh --rofi $HOME/.scripts/pactl.sh --rofi
;; ;;
--backup) --backup)
/home/sravan/.scripts/backup.sh --rofi $HOME/.scripts/backup.sh --rofi
;; ;;
--cpu-gpu) --cpu-gpu)
/home/sravan/.scripts/cpu-gpu.sh --rofi $HOME/.scripts/cpu-gpu.sh --rofi
;; ;;
--gaming) --gaming)
/home/sravan/.scripts/gaming.sh --rofi $HOME/.scripts/gaming.sh --rofi
;; ;;
--session) --session)
/home/sravan/.scripts/session.sh --rofi $HOME/.scripts/session.sh --rofi
;; ;;
--rofi) --rofi)
rofi_menu rofi_menu

View File

@ -11,5 +11,7 @@ export XDG_CURRENT_DESKTOP=wlroots # Set XDG current desktop
dwl & dwl &
/home/sravan/.scripts/wayland-startup.sh --kill-startup && (sleep 3 &&
/home/sravan/.scripts/wayland-startup.sh --startup $HOME/.scripts/wayland-startup.sh --kill-startup &&
sleep 2 &&
$HOME/.scripts/wayland-startup.sh --startup) &

View File

@ -31,8 +31,8 @@ declare -a delay_array=(\
"/usr/bin/syncthing-gtk" \ # Syncthing GTK "/usr/bin/syncthing-gtk" \ # Syncthing GTK
"/usr/bin/nextcloud" \ # NextCloud Client "/usr/bin/nextcloud" \ # NextCloud Client
"/usr/bin/nyrna" \ # Nyrna "/usr/bin/nyrna" \ # Nyrna
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "bash $HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor "bash $HOME/.scripts/picom.sh --on" \ # Picom Compositor
"/usr/bin/autorandr --change --force" \ # Auto restore screen layout "/usr/bin/autorandr --change --force" \ # Auto restore screen layout
"/usr/bin/numlockx on" \ # Enable numlock "/usr/bin/numlockx on" \ # Enable numlock
) )
@ -49,8 +49,8 @@ declare -a kill_delay_array=(\
"pkill syncthing-gtk" \ # Syncthing GTK "pkill syncthing-gtk" \ # Syncthing GTK
"pkill nextcloud" \ # NextCloud Client "pkill nextcloud" \ # NextCloud Client
"pkill nyrna" \ # Nyrna "pkill nyrna" \ # Nyrna
"bash /home/sravan/.scripts/dunst.sh --off" \ # Dunst Notification Daemon "bash $HOME/.scripts/dunst.sh --off" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --off" \ # Picom Compositor "bash $HOME/.scripts/picom.sh --off" \ # Picom Compositor
) )
help_menu() { help_menu() {

View File

@ -11,12 +11,12 @@ export _JAVA_AWT_WM_NONREPARENTING=1 # Java fix for Window Managers
xrdb ~/.Xresources xrdb ~/.Xresources
# Startup Applications # Startup Applications
/home/sravan/.scripts/x11-startup.sh --kill-startup && $HOME/.scripts/x11-startup.sh --kill-startup &&
/home/sravan/.scripts/x11-startup.sh --startup $HOME/.scripts/x11-startup.sh --startup
# Delayed Startup Applications # Delayed Startup Applications
(sleep 5 && (sleep 5 &&
/home/sravan/.scripts/x11-startup.sh --kill-delay && $HOME/.scripts/x11-startup.sh --kill-delay &&
/home/sravan/.scripts/x11-startup.sh --delay) & $HOME/.scripts/x11-startup.sh --delay) &
exec dwm exec dwm

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ $XDG_SESSION_DESKTOP == "dwm" ]; then if [ $XDG_SESSION_DESKTOP == "dwm" ]; then
/home/sravan/.scripts/picom.sh --on & $HOME/.scripts/picom.sh --on &
/usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false & /usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false &
fi fi
/home/sravan/.scripts/dunst.sh --unpause & $HOME/.scripts/dunst.sh --unpause &
/home/sravan/.scripts/cpu-gpu.sh --cpu-profile-balanced & $HOME/.scripts/cpu-gpu.sh --cpu-profile-balanced &
/home/sravan/.scripts/cpu-gpu.sh --gpu-profile-adaptive & $HOME/.scripts/cpu-gpu.sh --gpu-profile-adaptive &

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ $XDG_SESSION_DESKTOP == "dwm" ]; then if [ $XDG_SESSION_DESKTOP == "dwm" ]; then
/home/sravan/.scripts/picom.sh --off & $HOME/.scripts/picom.sh --off &
/usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true & /usr/bin/xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true &
fi fi
/home/sravan/.scripts/cpu-gpu.sh --cpu-profile-performance & $HOME/.scripts/cpu-gpu.sh --cpu-profile-performance &
/home/sravan/.scripts/cpu-gpu.sh --gpu-profile-performance & $HOME/.scripts/cpu-gpu.sh --gpu-profile-performance &
/home/sravan/.scripts/dunst.sh --pause & $HOME/.scripts/dunst.sh --pause &

View File

@ -38,13 +38,13 @@ main() {
help_menu help_menu
;; ;;
--dualsense-to-xbox-360) --dualsense-to-xbox-360)
kitty --hold /home/sravan/.scripts/dualsense_to_xbox_360_controller.sh kitty --hold $HOME/.scripts/dualsense_to_xbox_360_controller.sh
;; ;;
--game-launch) --game-launch)
/home/sravan/.scripts/game_launch.sh $HOME/.scripts/game_launch.sh
;; ;;
--game-exit) --game-exit)
/home/sravan/.scripts/game_exit.sh $HOME/.scripts/game_exit.sh
;; ;;
--rofi) --rofi)
rofi_menu rofi_menu

View File

@ -55,7 +55,7 @@ main() {
pkill picom pkill picom
fi fi
picom --config /home/sravan/.config/picom/picom.conf -b picom --config $HOME/.config/picom/picom.conf -b
notify-send "Turning Picom ON" notify-send "Turning Picom ON"
;; ;;