Git Editor, Dunst Appearance, Game Scripts, Session Control No Password, Startup Application Fixes

- Change dunst x-spacing to 0 in Xresources so notifications line up
  with edge of screen
- Change git editor to emacs in gitconfig and environment variable
- Remove git difftool from gitconfig
- Add game launch script to turn off compositor and toggle dnd for notifications
- Add game exit script to toggle dnd for notifications
- Remove pkexec from session.sh since password is not necessary
- Separate apps & system processes in startup.sh
- Start system processes in xinitrc
- Start tray apps after delay in xinitrc to fix issues w/ missing
  icons and scrolling / OSD not working
- Replace some polybar modules with tray applications
This commit is contained in:
Sravan Balaji
2021-05-23 16:02:40 -04:00
parent 045470636f
commit 1ddbd596b6
9 changed files with 206 additions and 105 deletions

View File

@@ -61,7 +61,7 @@ polybar.tray-scale: TRAY_SCALE
polybar.maxlen: MAXLEN polybar.maxlen: MAXLEN
! Dunst ! Dunst
dunst.geometry-x: OUTER_GAPS dunst.geometry-x: 0
dunst.geometry-y: BAR_HEIGHT dunst.geometry-y: BAR_HEIGHT
dunst.sep-height: BORDER_SIZE dunst.sep-height: BORDER_SIZE
dunst.padding: OUTER_GAPS dunst.padding: OUTER_GAPS

View File

@@ -35,8 +35,8 @@
# Remove file(s) from Git but not from disk # Remove file(s) from Git but not from disk
untrack = rm --cache -- untrack = rm --cache --
[core] [core]
# VSCode # Emacs
editor = code --wait editor = "emacs -nw"
# Don't consider trailing space change as a cause for merge conflicts # Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space whitespace = -trailing-space
[diff] [diff]
@@ -48,10 +48,6 @@
wordRegex = . wordRegex = .
# Display submodule-related information (commit listings) # Display submodule-related information (commit listings)
submodule = log submodule = log
# Use VSCode as default diff tool when running `git diff-tool`
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[fetch] [fetch]
# Auto-fetch submodule changes (sadly, won't auto-update) # Auto-fetch submodule changes (sadly, won't auto-update)
recurseSubmodules = on-demand recurseSubmodules = on-demand

2
.scripts/game_exit.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
/home/sravan/.scripts/dunst.sh --dnd

3
.scripts/game_launch.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
/home/sravan/.scripts/picom.sh --off
/home/sravan/.scripts/dunst.sh --dnd

View File

@@ -45,16 +45,16 @@ main() {
light-locker-command --lock light-locker-command --lock
;; ;;
--sleep) --sleep)
pkexec systemctl suspend systemctl suspend
;; ;;
--reboot) --reboot)
pkexec reboot reboot
;; ;;
--shutdown) --shutdown)
pkexec poweroff shutdown now
;; ;;
--hibernate) --hibernate)
pkexec systemctl hibernate systemctl hibernate
;; ;;
--restart) --restart)
xmonad --recompile xmonad --recompile

View File

@@ -1,43 +1,55 @@
#!/bin/bash #!/bin/bash
declare -a start_array=(\ declare -a system_array=(\
# Background Processes
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager
"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/lib/kdeconnectd --replace" \ # KDE Connect Daemon
# System Restore Processes # System Restore Processes
"bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout "bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout
"nitrogen --restore" \ # Restore wallpaper "nitrogen --restore" \ # Restore wallpaper
"numlockx on" \ # Enable numlock "numlockx on" \ # Enable numlock
)
declare -a kill_system_array=(\
# Background Processes
"killall dunst" \ # Dunst Notification Daemon
"killall picom" \ # Picom Compositor
"killall greenclip" \ # Greenclip Clipboard Manager
"killall redshift" \ # Redshift Blue Light Filter
"killall polkit" \ # GNOME Polkit Authentication Agent
"killall light-locker" \ # Screen lock for lightdm
"killall kdeconnectd" \ # KDE Connect Daemon
)
declare -a apps_array=(\
# System Tray Applications # System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter
"nyrna" \ # Nyrna Application Suspend "nyrna" \ # Nyrna Application Suspend
"blueman-tray" \ # Blueman Bluetooth Manager "blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet "nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect "kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool "flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager "xfce4-power-manager" \ # XFCE4 Power Manager
# Background Processes "volctl" \ # PulseAudio Volume Control
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma
"redshift-gtk" \ # Redshift Blue Light Filter
"/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
) )
declare -a kill_array=(\ declare -a kill_apps_array=(\
# System Tray Applications # System Tray Applications
"pkill nyrna" \ # Nyrna Application Suspend "killall redshift" \ # Redshift Blue Light Filter
"pkill blueman-tray" \ # Blueman Bluetooth Manager "killall nyrna" \ # Nyrna Application Suspend
"pkill nm-applet" \ # Network Manager Applet "killall blueman-tray" \ # Blueman Bluetooth Manager
"pkill kdeconnect-indicator" \ # KDE Connect "killall nm-applet" \ # Network Manager Applet
"pkill flameshot" \ # Flameshot Screenshot Tool "killall kdeconnect-indicator" \ # KDE Connect Indicator
"pkill xfce4-power-manager" \ # XFCE4 Power Manager "killall flameshot" \ # Flameshot Screenshot Tool
# Background Processes "killall xfce4-power-manager" \ # XFCE4 Power Manager
"bash /home/sravan/.scripts/picom.sh --off" \ # Picom Compositor "killall volctl" \ # PulseAudio Volume Control
"bash /home/sravan/.scripts/dunst.sh --off" \ # Dunst Notification Daemon
"pkill greenclip" \ # Greenclip Clipboard Manager
"pkill redshift" \ # Redshift Blue Light Filter
"pkill polkit" \ # GNOME Polkit Authentication Agent
"pkill light-locker" \ # screen lock for lightdm
) )
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 autostart processes & applications. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause" # echo " - Play / Pause: playerctl.sh --play-pause"
@@ -50,8 +62,10 @@ help_menu() {
rofi_menu() { rofi_menu() {
declare -a options=( declare -a options=(
" Launch Autostart Processes - start" " Launch System Processes - system"
"ﮊ Kill Autostart Processes - kill" " Launch Tray Applications - apps"
"ﮊ Kill System Processes - kill-system"
"ﮊ Kill Tray Applications - kill-apps"
" Quit - quit" " Quit - quit"
) )
@@ -72,11 +86,8 @@ main() {
--help | -h) --help | -h)
help_menu help_menu
;; ;;
--start) --system)
main "--kill" for i in "${system_array[@]}"
# Run applications (ignore if they don't exist)
for i in "${start_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -86,9 +97,30 @@ main() {
fi fi
done done
;; ;;
--kill) --apps)
# Kill applications (ignore if they don't exist) for i in "${apps_array[@]}"
for i in "${kill_array[@]}" do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--kill-system)
for i in "${kill_system_array[@]}"
do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--kill-apps)
for i in "${kill_apps_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then

View File

@@ -2,12 +2,21 @@
export TERM=xterm-256color # Sets the terminal type export TERM=xterm-256color # Sets the terminal type
export SHELL=/usr/bin/fish # Preferred shell export SHELL=/usr/bin/fish # Preferred shell
export EDITOR="emacs -nw" # Default editor export EDITOR="emacs -nw" # Default editor
export GIT_EDITOR="emacs -nw" # Default git editor
export BROWSER=vivaldi-stable # Web Browser export BROWSER=vivaldi-stable # Web Browser
export XDG_CONFIG_HOME=$HOME/.config # Set Config directory export XDG_CONFIG_HOME=$HOME/.config # Set Config directory
export QT_QPA_PLATFORMTHEME=qt5ct # QGtkStyle export QT_QPA_PLATFORMTHEME=qt5ct # QGtkStyle
xrdb ~/.Xresources xrdb ~/.Xresources
/home/sravan/.scripts/startup.sh --start # Background Processes & Daemons
/home/sravan/.scripts/startup.sh --kill-system &&
/home/sravan/.scripts/startup.sh --system
# System Tray Applications
# start with a delay so window manager can load first
(sleep 5 &&
/home/sravan/.scripts/startup.sh --kill-apps &&
/home/sravan/.scripts/startup.sh --apps) &
exec xmonad exec xmonad

Submodule .xmonad updated: cbed4fea8f...f1a1d837c3

View File

@@ -112,8 +112,8 @@ Pull and update submodules
# Remove file(s) from Git but not from disk # Remove file(s) from Git but not from disk
untrack = rm --cache -- untrack = rm --cache --
[core] [core]
# VSCode # Emacs
editor = code --wait editor = "emacs -nw"
# Don't consider trailing space change as a cause for merge conflicts # Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space whitespace = -trailing-space
[diff] [diff]
@@ -125,10 +125,6 @@ Pull and update submodules
wordRegex = . wordRegex = .
# Display submodule-related information (commit listings) # Display submodule-related information (commit listings)
submodule = log submodule = log
# Use VSCode as default diff tool when running `git diff-tool`
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[fetch] [fetch]
# Auto-fetch submodule changes (sadly, won't auto-update) # Auto-fetch submodule changes (sadly, won't auto-update)
recurseSubmodules = on-demand recurseSubmodules = on-demand
@@ -6407,6 +6403,7 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
export TERM=xterm-256color # Sets the terminal type export TERM=xterm-256color # Sets the terminal type
export SHELL=/usr/bin/fish # Preferred shell export SHELL=/usr/bin/fish # Preferred shell
export EDITOR="emacs -nw" # Default editor export EDITOR="emacs -nw" # Default editor
export GIT_EDITOR="emacs -nw" # Default git editor
export BROWSER=vivaldi-stable # Web Browser export BROWSER=vivaldi-stable # Web Browser
export XDG_CONFIG_HOME=$HOME/.config # Set Config directory export XDG_CONFIG_HOME=$HOME/.config # Set Config directory
export QT_QPA_PLATFORMTHEME=qt5ct # QGtkStyle export QT_QPA_PLATFORMTHEME=qt5ct # QGtkStyle
@@ -6421,7 +6418,15 @@ 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
/home/sravan/.scripts/startup.sh --start # Background Processes & Daemons
/home/sravan/.scripts/startup.sh --kill-system &&
/home/sravan/.scripts/startup.sh --system
# System Tray Applications
# start with a delay so window manager can load first
(sleep 5 &&
/home/sravan/.scripts/startup.sh --kill-apps &&
/home/sravan/.scripts/startup.sh --apps) &
#+end_src #+end_src
*** Launch Environment *** Launch Environment
@@ -6562,7 +6567,7 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
#+begin_src conf :tangle .Xresources #+begin_src conf :tangle .Xresources
! Dunst ! Dunst
dunst.geometry-x: OUTER_GAPS dunst.geometry-x: 0
dunst.geometry-y: BAR_HEIGHT dunst.geometry-y: BAR_HEIGHT
dunst.sep-height: BORDER_SIZE dunst.sep-height: BORDER_SIZE
dunst.padding: OUTER_GAPS dunst.padding: OUTER_GAPS
@@ -6828,16 +6833,16 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
light-locker-command --lock light-locker-command --lock
;; ;;
--sleep) --sleep)
pkexec systemctl suspend systemctl suspend
;; ;;
--reboot) --reboot)
pkexec reboot reboot
;; ;;
--shutdown) --shutdown)
pkexec poweroff shutdown now
;; ;;
--hibernate) --hibernate)
pkexec systemctl hibernate systemctl hibernate
;; ;;
--restart) --restart)
xmonad --recompile xmonad --recompile
@@ -6856,45 +6861,57 @@ 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 start_array=(\ declare -a system_array=(\
# Background Processes
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager
"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/lib/kdeconnectd --replace" \ # KDE Connect Daemon
# System Restore Processes # System Restore Processes
"bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout "bash /home/sravan/.screenlayout/default.sh" \ # Restore default screen layout
"nitrogen --restore" \ # Restore wallpaper "nitrogen --restore" \ # Restore wallpaper
"numlockx on" \ # Enable numlock "numlockx on" \ # Enable numlock
)
declare -a kill_system_array=(\
# Background Processes
"killall dunst" \ # Dunst Notification Daemon
"killall picom" \ # Picom Compositor
"killall greenclip" \ # Greenclip Clipboard Manager
"killall redshift" \ # Redshift Blue Light Filter
"killall polkit" \ # GNOME Polkit Authentication Agent
"killall light-locker" \ # Screen lock for lightdm
"killall kdeconnectd" \ # KDE Connect Daemon
)
declare -a apps_array=(\
# System Tray Applications # System Tray Applications
"redshift-gtk" \ # Redshift Blue Light Filter
"nyrna" \ # Nyrna Application Suspend "nyrna" \ # Nyrna Application Suspend
"blueman-tray" \ # Blueman Bluetooth Manager "blueman-tray" \ # Blueman Bluetooth Manager
"nm-applet" \ # Network Manager Applet "nm-applet" \ # Network Manager Applet
"kdeconnect-indicator" \ # KDE Connect "kdeconnect-indicator" \ # KDE Connect Indicator
"flameshot" \ # Flameshot Screenshot Tool "flameshot" \ # Flameshot Screenshot Tool
"xfce4-power-manager" \ # XFCE4 Power Manager "xfce4-power-manager" \ # XFCE4 Power Manager
# Background Processes "volctl" \ # PulseAudio Volume Control
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma
"redshift-gtk" \ # Redshift Blue Light Filter
"/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
) )
declare -a kill_array=(\ declare -a kill_apps_array=(\
# System Tray Applications # System Tray Applications
"pkill nyrna" \ # Nyrna Application Suspend "killall redshift" \ # Redshift Blue Light Filter
"pkill blueman-tray" \ # Blueman Bluetooth Manager "killall nyrna" \ # Nyrna Application Suspend
"pkill nm-applet" \ # Network Manager Applet "killall blueman-tray" \ # Blueman Bluetooth Manager
"pkill kdeconnect-indicator" \ # KDE Connect "killall nm-applet" \ # Network Manager Applet
"pkill flameshot" \ # Flameshot Screenshot Tool "killall kdeconnect-indicator" \ # KDE Connect Indicator
"pkill xfce4-power-manager" \ # XFCE4 Power Manager "killall flameshot" \ # Flameshot Screenshot Tool
# Background Processes "killall xfce4-power-manager" \ # XFCE4 Power Manager
"bash /home/sravan/.scripts/picom.sh --off" \ # Picom Compositor "killall volctl" \ # PulseAudio Volume Control
"bash /home/sravan/.scripts/dunst.sh --off" \ # Dunst Notification Daemon
"pkill greenclip" \ # Greenclip Clipboard Manager
"pkill redshift" \ # Redshift Blue Light Filter
"pkill polkit" \ # GNOME Polkit Authentication Agent
"pkill light-locker" \ # screen lock for lightdm
) )
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 autostart processes & applications. Use only one argument at a time."
# echo " - Play / Pause: playerctl.sh --play-pause" # echo " - Play / Pause: playerctl.sh --play-pause"
@@ -6907,8 +6924,10 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
rofi_menu() { rofi_menu() {
declare -a options=( declare -a options=(
" Launch Autostart Processes - start" " Launch System Processes - system"
"ﮊ Kill Autostart Processes - kill" " Launch Tray Applications - apps"
"ﮊ Kill System Processes - kill-system"
"ﮊ Kill Tray Applications - kill-apps"
" Quit - quit" " Quit - quit"
) )
@@ -6929,11 +6948,8 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
--help | -h) --help | -h)
help_menu help_menu
;; ;;
--start) --system)
main "--kill" for i in "${system_array[@]}"
# Run applications (ignore if they don't exist)
for i in "${start_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -6943,9 +6959,30 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
fi fi
done done
;; ;;
--kill) --apps)
# Kill applications (ignore if they don't exist) for i in "${apps_array[@]}"
for i in "${kill_array[@]}" do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--kill-system)
for i in "${kill_system_array[@]}"
do
if ! command -v $i > /dev/null
then
do_nothing() { :; }
else
$i &
fi
done
;;
--kill-apps)
for i in "${kill_apps_array[@]}"
do do
if ! command -v $i > /dev/null if ! command -v $i > /dev/null
then then
@@ -6964,6 +7001,28 @@ Configuration for Alacritty, the GPU enhanced terminal emulator.
main $@ main $@
#+end_src #+end_src
** Gaming
These are scripts that should be run from Lutris when launching or exiting a game.
*** Pre-Launch Script
*Preferences > System options > Pre-launch script*
#+begin_src shell :shebang #!/bin/bash :tangle .scripts/game_launch.sh
/home/sravan/.scripts/picom.sh --off
/home/sravan/.scripts/dunst.sh --dnd
#+end_src
*** Post-Exit Script
*Preferences > System options > Post-exit script*
#+begin_src shell :shebang #!/bin/bash :tangle .scripts/game_exit.sh
/home/sravan/.scripts/dunst.sh --dnd
#+end_src
** Control Center ** Control Center
#+begin_src shell :shebang #!/bin/bash :tangle .scripts/control-center.sh #+begin_src shell :shebang #!/bin/bash :tangle .scripts/control-center.sh