Autorandr & Startup Script Update

- Add autorandr postswitch script
- dwm flexipatch gride mode layout & rule changes
- startup and delay processes in startup.sh to use autorandr
This commit is contained in:
Sravan Balaji
2021-06-25 18:09:15 -04:00
parent e35ea7a9ab
commit 092b7b7853
7 changed files with 91 additions and 83 deletions

3
.config/autorandr/postswitch Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
/usr/bin/nitrogen --restore # Restore wallpaper
/home/sravan/.scripts/session.sh --restart # Restart dwm

View File

@@ -91,7 +91,6 @@ button:hover {
font-size: 12px; font-size: 12px;
} }
.userbuttonlabel:hover { .userbuttonlabel:hover {
color: #f8f8f2; color: #f8f8f2;
} }

View File

@@ -1,20 +1,16 @@
#!/bin/bash #!/bin/bash
declare -a system_array=(\ declare -a startup_array=(\
# Background Processes # Background Processes
"bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center "bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor "bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager "/usr/bin/greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma "/usr/bin/redshift -x" \ # Reset redshift display gamma
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent
"light-locker --lock-on-suspend --lock-on-lid" \ # Screen lock for lightdm "/usr/bin/light-locker --lock-on-suspend --lock-on-lid" \ # Screen lock for lightdm
"/usr/lib/kdeconnectd --replace" \ # KDE Connect Daemon "/usr/lib/kdeconnectd --replace" \ # KDE Connect Daemon
# System Restore Processes
"bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout
"nitrogen --restore" \ # Restore wallpaper
"numlockx on" \ # Enable numlock
) )
declare -a kill_system_array=(\ declare -a kill_startup_array=(\
# Background Processes # Background Processes
"killall deadd-notificat" \ # Deadd Notification Center "killall deadd-notificat" \ # Deadd Notification Center
"killall picom" \ # Picom Compositor "killall picom" \ # Picom Compositor
@@ -25,19 +21,22 @@ declare -a kill_system_array=(\
"killall kdeconnectd" \ # KDE Connect Daemon "killall kdeconnectd" \ # KDE Connect Daemon
) )
declare -a apps_array=(\ declare -a delay_array=(\
# System Tray Applications # System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter "/usr/bin/redshift-gtk" \ # Redshift Blue Light Filter
"bauh-tray" \ # Bauh Package Management GUI "/usr/bin/bauh-tray" \ # Bauh Package Management GUI
"blueman-tray" \ # Blueman Bluetooth Manager "/usr/bin/blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet "/usr/bin/nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect Indicator "/usr/bin/kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool "/usr/bin/flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager "/usr/bin/xfce4-power-manager" \ # XFCE4 Power Manager
"volctl" \ # PulseAudio Volume Control "/usr/bin/volctl" \ # PulseAudio Volume Control
# System Restore Processes
"/usr/bin/autorandr --change --force" \ # Auto restore screen layout
"/usr/bin/numlockx on" \ # Enable numlock
) )
declare -a kill_apps_array=(\ declare -a kill_delay_array=(\
# System Tray Applications # System Tray Applications
"killall redshift" \ # Redshift Blue Light Filter "killall redshift" \ # Redshift Blue Light Filter
"killall bauh-tray" \ # Bauh Package Management GUI "killall bauh-tray" \ # Bauh Package Management GUI
@@ -51,7 +50,7 @@ declare -a kill_apps_array=(\
help_menu() { help_menu() {
echo "Main script to launch and kill autostart processes & applications. Use only one argument at a time." echo "Main script to launch and kill startup processes. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause" # echo " - Play / Pause: playerctl.sh --play-pause"
# echo " - Next: playerctl.sh --next" # echo " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev" # echo " - Previous: playerctl.sh --prev"
@@ -62,10 +61,10 @@ help_menu() {
rofi_menu() { rofi_menu() {
declare -a options=( declare -a options=(
" Launch System Processes - system" " Launch Startup Processes - startup"
" Launch Tray Applications - apps" " Launch Delayed Processes - delay"
" Kill System Processes - kill-system" " Kill Startup Processes - kill-startup"
" Kill Tray Applications - kill-apps" " Kill Delayed Processes - kill-delay"
" Quit - quit" " Quit - quit"
) )
@@ -86,8 +85,8 @@ main() {
--help | -h) --help | -h)
help_menu help_menu
;; ;;
--system) --startup)
for i in "${system_array[@]}" for i in "${startup_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -97,8 +96,8 @@ main() {
fi fi
done done
;; ;;
--apps) --delay)
for i in "${apps_array[@]}" for i in "${delay_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -108,8 +107,8 @@ main() {
fi fi
done done
;; ;;
--kill-system) --kill-startup)
for i in "${kill_system_array[@]}" for i in "${kill_startup_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -119,8 +118,8 @@ main() {
fi fi
done done
;; ;;
--kill-apps) --kill-delay)
for i in "${kill_apps_array[@]}" for i in "${kill_delay_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then

View File

@@ -9,14 +9,13 @@ export QT_QPA_PLATFORMTHEME=qt5ct # QGtkStyle
xrdb ~/.Xresources xrdb ~/.Xresources
# Background Processes & Daemons # Startup Applications
/home/sravan/.scripts/startup.sh --kill-system && /home/sravan/.scripts/startup.sh --kill-startup &&
/home/sravan/.scripts/startup.sh --system /home/sravan/.scripts/startup.sh --startup
# System Tray Applications # Delayed Startup Applications
# start with a delay so window manager can load first
(sleep 5 && (sleep 5 &&
/home/sravan/.scripts/startup.sh --kill-apps && /home/sravan/.scripts/startup.sh --kill-delay &&
/home/sravan/.scripts/startup.sh --apps) & /home/sravan/.scripts/startup.sh --delay) &
exec dwm exec dwm

View File

@@ -1080,7 +1080,6 @@ Each label is represented as a clickable button in the notification center. The
font-size: 12px; font-size: 12px;
} }
.userbuttonlabel:hover { .userbuttonlabel:hover {
color: #f8f8f2; color: #f8f8f2;
} }
@@ -2072,7 +2071,18 @@ Each label is represented as a clickable button in the notification center. The
} }
#+end_src #+end_src
* Display Effects * Display Configuration & Effects
** Autorandr
See [[https://github.com/phillipberndt/autorandr#hook-scripts][autorandr hook scripts]] for more information.
*** Post Switch
#+begin_src shell :shebang #!/bin/bash :tangle .config/autorandr/postswitch
/usr/bin/nitrogen --restore # Restore wallpaper
/home/sravan/.scripts/session.sh --restart # Restart dwm
#+end_src
** Compositor ** Compositor
*** Picom Jonaburg *** Picom Jonaburg
@@ -6914,15 +6924,14 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
*** Startup Applications & Processes *** Startup Applications & Processes
#+begin_src shell :shebang #!/bin/sh :tangle .xinitrc #+begin_src shell :shebang #!/bin/sh :tangle .xinitrc
# Background Processes & Daemons # Startup Applications
/home/sravan/.scripts/startup.sh --kill-system && /home/sravan/.scripts/startup.sh --kill-startup &&
/home/sravan/.scripts/startup.sh --system /home/sravan/.scripts/startup.sh --startup
# System Tray Applications # Delayed Startup Applications
# start with a delay so window manager can load first
(sleep 5 && (sleep 5 &&
/home/sravan/.scripts/startup.sh --kill-apps && /home/sravan/.scripts/startup.sh --kill-delay &&
/home/sravan/.scripts/startup.sh --apps) & /home/sravan/.scripts/startup.sh --delay) &
#+end_src #+end_src
*** Launch Environment *** Launch Environment
@@ -7419,22 +7428,18 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
** Startup ** Startup
#+begin_src shell :shebang #!/bin/bash :tangle .scripts/startup.sh #+begin_src shell :shebang #!/bin/bash :tangle .scripts/startup.sh
declare -a system_array=(\ declare -a startup_array=(\
# Background Processes # Background Processes
"bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center "bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor "bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager "/usr/bin/greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma "/usr/bin/redshift -x" \ # Reset redshift display gamma
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent
"light-locker --lock-on-suspend --lock-on-lid" \ # Screen lock for lightdm "/usr/bin/light-locker --lock-on-suspend --lock-on-lid" \ # Screen lock for lightdm
"/usr/lib/kdeconnectd --replace" \ # KDE Connect Daemon "/usr/lib/kdeconnectd --replace" \ # KDE Connect Daemon
# System Restore Processes
"bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout
"nitrogen --restore" \ # Restore wallpaper
"numlockx on" \ # Enable numlock
) )
declare -a kill_system_array=(\ declare -a kill_startup_array=(\
# Background Processes # Background Processes
"killall deadd-notificat" \ # Deadd Notification Center "killall deadd-notificat" \ # Deadd Notification Center
"killall picom" \ # Picom Compositor "killall picom" \ # Picom Compositor
@@ -7445,19 +7450,22 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
"killall kdeconnectd" \ # KDE Connect Daemon "killall kdeconnectd" \ # KDE Connect Daemon
) )
declare -a apps_array=(\ declare -a delay_array=(\
# System Tray Applications # System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter "/usr/bin/redshift-gtk" \ # Redshift Blue Light Filter
"bauh-tray" \ # Bauh Package Management GUI "/usr/bin/bauh-tray" \ # Bauh Package Management GUI
"blueman-tray" \ # Blueman Bluetooth Manager "/usr/bin/blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet "/usr/bin/nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect Indicator "/usr/bin/kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool "/usr/bin/flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager "/usr/bin/xfce4-power-manager" \ # XFCE4 Power Manager
"volctl" \ # PulseAudio Volume Control "/usr/bin/volctl" \ # PulseAudio Volume Control
# System Restore Processes
"/usr/bin/autorandr --change --force" \ # Auto restore screen layout
"/usr/bin/numlockx on" \ # Enable numlock
) )
declare -a kill_apps_array=(\ declare -a kill_delay_array=(\
# System Tray Applications # System Tray Applications
"killall redshift" \ # Redshift Blue Light Filter "killall redshift" \ # Redshift Blue Light Filter
"killall bauh-tray" \ # Bauh Package Management GUI "killall bauh-tray" \ # Bauh Package Management GUI
@@ -7471,7 +7479,7 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
help_menu() { help_menu() {
echo "Main script to launch and kill autostart processes & applications. Use only one argument at a time." echo "Main script to launch and kill startup processes. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause" # echo " - Play / Pause: playerctl.sh --play-pause"
# echo " - Next: playerctl.sh --next" # echo " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev" # echo " - Previous: playerctl.sh --prev"
@@ -7482,10 +7490,10 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
rofi_menu() { rofi_menu() {
declare -a options=( declare -a options=(
" Launch System Processes - system" " Launch Startup Processes - startup"
" Launch Tray Applications - apps" " Launch Delayed Processes - delay"
" Kill System Processes - kill-system" " Kill Startup Processes - kill-startup"
" Kill Tray Applications - kill-apps" " Kill Delayed Processes - kill-delay"
" Quit - quit" " Quit - quit"
) )
@@ -7506,8 +7514,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
--help | -h) --help | -h)
help_menu help_menu
;; ;;
--system) --startup)
for i in "${system_array[@]}" for i in "${startup_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -7517,8 +7525,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi fi
done done
;; ;;
--apps) --delay)
for i in "${apps_array[@]}" for i in "${delay_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -7528,8 +7536,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi fi
done done
;; ;;
--kill-system) --kill-startup)
for i in "${kill_system_array[@]}" for i in "${kill_startup_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -7539,8 +7547,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi fi
done done
;; ;;
--kill-apps) --kill-delay)
for i in "${kill_apps_array[@]}" for i in "${kill_delay_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then