nvim transparency now decent and more theme related stuff
This commit is contained in:
parent
6a32e7eeb6
commit
dc36449701
7 changed files with 78 additions and 12 deletions
41
.local/share/scripts/powermenu.sh
Executable file
41
.local/share/scripts/powermenu.sh
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Define options
|
||||
options="Shutdown\nRestart\nSuspend\nLock"
|
||||
|
||||
# Prompt user to select an option using Rofi
|
||||
selected_option=$(echo -e "$options" | rofi -dmenu -p "Power Menu")
|
||||
|
||||
# Function to display confirmation dialog
|
||||
confirm_action() {
|
||||
rofi -dmenu -p "$1" <<<"Yes\nNo"
|
||||
}
|
||||
|
||||
# Perform action based on selected option
|
||||
case $selected_option in
|
||||
"Shutdown")
|
||||
confirmation=$(confirm_action "Shutdown?")
|
||||
if [ "$confirmation" == "Yes" ]; then
|
||||
systemctl poweroff
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
"Restart")
|
||||
confirmation=$(confirm_action "Restart?")
|
||||
if [ "$confirmation" == "Yes" ]; then
|
||||
systemctl reboot
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
"Suspend")
|
||||
systemctl suspend
|
||||
;;
|
||||
"Lock")
|
||||
i3-msg exit
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
|
@ -9,11 +9,14 @@ theme_options=(
|
|||
)
|
||||
|
||||
# rofi script to get what theme to use
|
||||
chosen=$(printf '%s\n' "${theme_options[@]}" | rofi -dmenu -p "Choose a theme")
|
||||
chosen=$(printf '%s\n' "${theme_options[@]}" | rofi -dmenu -p "Theme")
|
||||
|
||||
theme=$(echo "${chosen}" | cut -d- -f1)
|
||||
background=$(echo "${chosen}" | cut -d- -f2)
|
||||
theme=$(echo "${chosen}" | rev | cut -d- -f2- | rev)
|
||||
|
||||
background=$(echo "${chosen}" | awk -F'-' '{print $NF}')
|
||||
|
||||
echo "Theme: ${theme}"
|
||||
echo "Background: ${background}"
|
||||
# change rofi theme
|
||||
sed -i "s/\(@import \".config\/rofi\/colors\/\).*/\1${theme}-${background}.rasi\"/" ~/.config/rofi/config.rasi
|
||||
|
||||
|
@ -24,5 +27,6 @@ sed -i "s/\(local background = \).*/\1\"${background}\"/" ~/.config/nvim/lua/tso
|
|||
# change xresources
|
||||
xresources_themes=".Xresources.d"
|
||||
sed -i "s/#include \".*\"/#include \"~\/${xresources_themes}\/${theme}-${background}\"/" ~/.Xresources
|
||||
xrdb ~/.Xresources
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue