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;
}
.userbuttonlabel:hover {
color: #f8f8f2;
}

View File

@@ -1,20 +1,16 @@
#!/bin/bash
declare -a system_array=(\
declare -a startup_array=(\
# Background Processes
"bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma
"/usr/bin/greenclip daemon" \ # Greenclip Clipboard Manager
"/usr/bin/redshift -x" \ # Reset redshift display gamma
"/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
# 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
"killall deadd-notificat" \ # Deadd Notification Center
"killall picom" \ # Picom Compositor
@@ -25,19 +21,22 @@ declare -a kill_system_array=(\
"killall kdeconnectd" \ # KDE Connect Daemon
)
declare -a apps_array=(\
declare -a delay_array=(\
# System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter
"bauh-tray" \ # Bauh Package Management GUI
"blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager
"volctl" \ # PulseAudio Volume Control
"/usr/bin/redshift-gtk" \ # Redshift Blue Light Filter
"/usr/bin/bauh-tray" \ # Bauh Package Management GUI
"/usr/bin/blueman-tray" \ # Blueman Bluetooth Manager
"/usr/bin/nm-applet" \ # Network Manager Applet
"/usr/bin/kdeconnect-indicator" \ # KDE Connect Indicator
"/usr/bin/flameshot" \ # Flameshot Screenshot Tool
"/usr/bin/xfce4-power-manager" \ # XFCE4 Power Manager
"/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
"killall redshift" \ # Redshift Blue Light Filter
"killall bauh-tray" \ # Bauh Package Management GUI
@@ -51,7 +50,7 @@ declare -a kill_apps_array=(\
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 " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev"
@@ -62,10 +61,10 @@ help_menu() {
rofi_menu() {
declare -a options=(
" Launch System Processes - system"
" Launch Tray Applications - apps"
" Kill System Processes - kill-system"
" Kill Tray Applications - kill-apps"
" Launch Startup Processes - startup"
" Launch Delayed Processes - delay"
" Kill Startup Processes - kill-startup"
" Kill Delayed Processes - kill-delay"
" Quit - quit"
)
@@ -86,8 +85,8 @@ main() {
--help | -h)
help_menu
;;
--system)
for i in "${system_array[@]}"
--startup)
for i in "${startup_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -97,8 +96,8 @@ main() {
fi
done
;;
--apps)
for i in "${apps_array[@]}"
--delay)
for i in "${delay_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -108,8 +107,8 @@ main() {
fi
done
;;
--kill-system)
for i in "${kill_system_array[@]}"
--kill-startup)
for i in "${kill_startup_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -119,8 +118,8 @@ main() {
fi
done
;;
--kill-apps)
for i in "${kill_apps_array[@]}"
--kill-delay)
for i in "${kill_delay_array[@]}"
do
if ! command -v $i > /dev/null
then

View File

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

View File

@@ -1080,7 +1080,6 @@ Each label is represented as a clickable button in the notification center. The
font-size: 12px;
}
.userbuttonlabel:hover {
color: #f8f8f2;
}
@@ -2072,7 +2071,18 @@ Each label is represented as a clickable button in the notification center. The
}
#+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
*** Picom Jonaburg
@@ -6914,15 +6924,14 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
*** Startup Applications & Processes
#+begin_src shell :shebang #!/bin/sh :tangle .xinitrc
# Background Processes & Daemons
/home/sravan/.scripts/startup.sh --kill-system &&
/home/sravan/.scripts/startup.sh --system
# Startup Applications
/home/sravan/.scripts/startup.sh --kill-startup &&
/home/sravan/.scripts/startup.sh --startup
# System Tray Applications
# start with a delay so window manager can load first
# Delayed Startup Applications
(sleep 5 &&
/home/sravan/.scripts/startup.sh --kill-apps &&
/home/sravan/.scripts/startup.sh --apps) &
/home/sravan/.scripts/startup.sh --kill-delay &&
/home/sravan/.scripts/startup.sh --delay) &
#+end_src
*** Launch Environment
@@ -7419,22 +7428,18 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
** Startup
#+begin_src shell :shebang #!/bin/bash :tangle .scripts/startup.sh
declare -a system_array=(\
declare -a startup_array=(\
# Background Processes
"bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma
"/usr/bin/greenclip daemon" \ # Greenclip Clipboard Manager
"/usr/bin/redshift -x" \ # Reset redshift display gamma
"/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
# 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
"killall deadd-notificat" \ # Deadd Notification Center
"killall picom" \ # Picom Compositor
@@ -7445,19 +7450,22 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
"killall kdeconnectd" \ # KDE Connect Daemon
)
declare -a apps_array=(\
declare -a delay_array=(\
# System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter
"bauh-tray" \ # Bauh Package Management GUI
"blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager
"volctl" \ # PulseAudio Volume Control
"/usr/bin/redshift-gtk" \ # Redshift Blue Light Filter
"/usr/bin/bauh-tray" \ # Bauh Package Management GUI
"/usr/bin/blueman-tray" \ # Blueman Bluetooth Manager
"/usr/bin/nm-applet" \ # Network Manager Applet
"/usr/bin/kdeconnect-indicator" \ # KDE Connect Indicator
"/usr/bin/flameshot" \ # Flameshot Screenshot Tool
"/usr/bin/xfce4-power-manager" \ # XFCE4 Power Manager
"/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
"killall redshift" \ # Redshift Blue Light Filter
"killall bauh-tray" \ # Bauh Package Management GUI
@@ -7471,7 +7479,7 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
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 " - Next: playerctl.sh --next"
# echo " - Previous: playerctl.sh --prev"
@@ -7482,10 +7490,10 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
rofi_menu() {
declare -a options=(
" Launch System Processes - system"
" Launch Tray Applications - apps"
" Kill System Processes - kill-system"
" Kill Tray Applications - kill-apps"
" Launch Startup Processes - startup"
" Launch Delayed Processes - delay"
" Kill Startup Processes - kill-startup"
" Kill Delayed Processes - kill-delay"
" Quit - quit"
)
@@ -7506,8 +7514,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
--help | -h)
help_menu
;;
--system)
for i in "${system_array[@]}"
--startup)
for i in "${startup_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -7517,8 +7525,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi
done
;;
--apps)
for i in "${apps_array[@]}"
--delay)
for i in "${delay_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -7528,8 +7536,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi
done
;;
--kill-system)
for i in "${kill_system_array[@]}"
--kill-startup)
for i in "${kill_startup_array[@]}"
do
if ! command -v $i > /dev/null
then
@@ -7539,8 +7547,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi
done
;;
--kill-apps)
for i in "${kill_apps_array[@]}"
--kill-delay)
for i in "${kill_delay_array[@]}"
do
if ! command -v $i > /dev/null
then