From 092b7b785323cbc06de69323fbff09e064b0597a Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Fri, 25 Jun 2021 18:09:15 -0400 Subject: [PATCH] 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 --- .config/autorandr/postswitch | 3 ++ .config/deadd/deadd.css | 1 - .config/dwm-flexipatch | 2 +- .config/emacs | 2 +- .scripts/startup.sh | 63 +++++++++++++------------ .xinitrc | 13 +++--- README.org | 90 ++++++++++++++++++++---------------- 7 files changed, 91 insertions(+), 83 deletions(-) create mode 100755 .config/autorandr/postswitch diff --git a/.config/autorandr/postswitch b/.config/autorandr/postswitch new file mode 100755 index 0000000..062e3ac --- /dev/null +++ b/.config/autorandr/postswitch @@ -0,0 +1,3 @@ +#!/bin/bash +/usr/bin/nitrogen --restore # Restore wallpaper +/home/sravan/.scripts/session.sh --restart # Restart dwm diff --git a/.config/deadd/deadd.css b/.config/deadd/deadd.css index a7225a7..ce5c161 100644 --- a/.config/deadd/deadd.css +++ b/.config/deadd/deadd.css @@ -91,7 +91,6 @@ button:hover { font-size: 12px; } - .userbuttonlabel:hover { color: #f8f8f2; } diff --git a/.config/dwm-flexipatch b/.config/dwm-flexipatch index 16169f3..bf17542 160000 --- a/.config/dwm-flexipatch +++ b/.config/dwm-flexipatch @@ -1 +1 @@ -Subproject commit 16169f3330addbcdaa85b60602a12b206dae79d6 +Subproject commit bf17542c0709306da354c73a5e4ce16832e68b17 diff --git a/.config/emacs b/.config/emacs index 5c9d8fb..1307b78 160000 --- a/.config/emacs +++ b/.config/emacs @@ -1 +1 @@ -Subproject commit 5c9d8fb5c746337de325a5c3f225582c7215b454 +Subproject commit 1307b78a5cb082637834a5a65b3ff03c04ec1840 diff --git a/.scripts/startup.sh b/.scripts/startup.sh index 5b57b34..21ef079 100755 --- a/.scripts/startup.sh +++ b/.scripts/startup.sh @@ -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 diff --git a/.xinitrc b/.xinitrc index 0971aa0..c7d0c1e 100755 --- a/.xinitrc +++ b/.xinitrc @@ -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 diff --git a/README.org b/README.org index ac2e16d..7d36c27 100644 --- a/README.org +++ b/README.org @@ -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