Cleanup dotfiles, fixed permissions

Also updated i3 config
This commit is contained in:
Tristaan
2021-01-19 17:19:26 +01:00
parent dc12ab6e04
commit f21bbe6edb
62 changed files with 35 additions and 991 deletions

View File

@@ -0,0 +1,40 @@
#!/bin/bash
#LOCKSCRIPT="i3lock-extra -m pixelize"
FG_COLOR="#d7d7d7"
BG_COLOR="#15325A"
SF_COLOR="#3555d7"
SB_COLOR="#6484c7"
color="-bg $BG_COLOR -fg $FG_COLOR -hlfg $SF_COLOR -hlbg $SB_COLOR -bw 0"
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[Shutdown]="systemctl poweroff"
[Reboot]="systemctl reboot"
[Hibernate]="systemctl hibernate"
[Suspend]="systemctl suspend"
[Halt]="systemctl halt"
[Lock]="~/.i3/scripts/locker.sh"
[Logout]="exit"
[Cancel]="Cancel"
)
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher="rofi -dmenu -hide-scrollbar -width 10"
launcher_opt="-i -yoffset 23 -location 3 $color"
selection=$(printf '%s\n' ${!menu[@]} | sort | eval '$launcher $launcher_opt -font "Hack-Regular 12" -lines 8')
if [ $selection == "Cancel" ] || [ -z $selection ]; then
exit 1
else
if [[ ${menu_confirm[*]} =~ $selection ]]; then
confirm=$(printf 'Yes\nNo\n' | eval '$launcher $launcher_opt -l 2 -font "Hack-Regular 12"')
if [[ $confirm == 'Yes' ]]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi