💄 style(rofi): scripts indentation
This commit is contained in:
parent
d43014b6f4
commit
03e5dbd9ca
4 changed files with 72 additions and 72 deletions
|
@ -11,70 +11,70 @@ yes=''
|
||||||
no=''
|
no=''
|
||||||
|
|
||||||
rofi_cmd() {
|
rofi_cmd() {
|
||||||
rofi -dmenu \
|
rofi -dmenu \
|
||||||
-p "Uptime: $uptime" \
|
-p "Uptime: $uptime" \
|
||||||
-mesg "Uptime: $uptime" \
|
-mesg "Uptime: $uptime" \
|
||||||
-theme ~/.config/rofi/scripts/powermenu/style.rasi
|
-theme ~/.config/rofi/scripts/powermenu/style.rasi
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm_cmd() {
|
confirm_cmd() {
|
||||||
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \
|
rofi -theme-str 'window {location: center; anchor: center; fullscreen: false; width: 350px;}' \
|
||||||
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
|
-theme-str 'mainbox {children: [ "message", "listview" ];}' \
|
||||||
-theme-str 'listview {columns: 2; lines: 1;}' \
|
-theme-str 'listview {columns: 2; lines: 1;}' \
|
||||||
-theme-str 'element-text {horizontal-align: 0.5;}' \
|
-theme-str 'element-text {horizontal-align: 0.5;}' \
|
||||||
-theme-str 'textbox {horizontal-align: 0.5;}' \
|
-theme-str 'textbox {horizontal-align: 0.5;}' \
|
||||||
-dmenu \
|
-dmenu \
|
||||||
-p 'Confirmation' \
|
-p 'Confirmation' \
|
||||||
-mesg 'Are you sure?' \
|
-mesg 'Are you sure?' \
|
||||||
-theme ~/.config/rofi/scripts/powermenu/style.rasi
|
-theme ~/.config/rofi/scripts/powermenu/style.rasi
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm_exit() {
|
confirm_exit() {
|
||||||
echo -e "$yes\n$no" | confirm_cmd
|
echo -e "$yes\n$no" | confirm_cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
run_rofi() {
|
run_rofi() {
|
||||||
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
|
echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
# Execute Command
|
# Execute Command
|
||||||
run_cmd() {
|
run_cmd() {
|
||||||
selected="$(confirm_exit)"
|
selected="$(confirm_exit)"
|
||||||
if [[ "$selected" == "$yes" ]]; then
|
if [[ "$selected" == "$yes" ]]; then
|
||||||
if [[ $1 == '--shutdown' ]]; then
|
if [[ $1 == '--shutdown' ]]; then
|
||||||
systemctl poweroff
|
systemctl poweroff
|
||||||
elif [[ $1 == '--reboot' ]]; then
|
elif [[ $1 == '--reboot' ]]; then
|
||||||
systemctl reboot
|
systemctl reboot
|
||||||
elif [[ $1 == '--suspend' ]]; then
|
elif [[ $1 == '--suspend' ]]; then
|
||||||
mpc -q pause
|
mpc -q pause
|
||||||
hyprlock
|
hyprlock
|
||||||
systemctl suspend
|
systemctl suspend
|
||||||
elif [[ $1 == '--logout' ]]; then
|
elif [[ $1 == '--logout' ]]; then
|
||||||
hyprctl dispatch exit
|
hyprctl dispatch exit
|
||||||
elif [[ $1 == '--lock' ]]; then
|
elif [[ $1 == '--lock' ]]; then
|
||||||
hyprlock
|
hyprlock
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Actions
|
# Actions
|
||||||
chosen="$(run_rofi)"
|
chosen="$(run_rofi)"
|
||||||
case ${chosen} in
|
case ${chosen} in
|
||||||
$shutdown)
|
$shutdown)
|
||||||
run_cmd --shutdown
|
run_cmd --shutdown
|
||||||
;;
|
;;
|
||||||
$reboot)
|
$reboot)
|
||||||
run_cmd --reboot
|
run_cmd --reboot
|
||||||
;;
|
;;
|
||||||
$lock)
|
$lock)
|
||||||
run_cmd --lock
|
run_cmd --lock
|
||||||
;;
|
;;
|
||||||
$suspend)
|
$suspend)
|
||||||
run_cmd --suspend
|
run_cmd --suspend
|
||||||
;;
|
;;
|
||||||
$logout)
|
$logout)
|
||||||
run_cmd --logout
|
run_cmd --logout
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "$1" = "--freeze" ]; then
|
if [ "$1" = "--freeze" ]; then
|
||||||
extra_args="--freeze"
|
extra_args="--freeze"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
|
@ -20,15 +20,15 @@ folder=""
|
||||||
selected="$(echo -e "$region\n$output\n$window\n$folder" | rofi -dmenu -theme "${theme}")"
|
selected="$(echo -e "$region\n$output\n$window\n$folder" | rofi -dmenu -theme "${theme}")"
|
||||||
case $selected in
|
case $selected in
|
||||||
$region)
|
$region)
|
||||||
$command -m region
|
$command -m region
|
||||||
;;
|
;;
|
||||||
$output)
|
$output)
|
||||||
$command -m output
|
$command -m output
|
||||||
;;
|
;;
|
||||||
$window)
|
$window)
|
||||||
$command -m window
|
$command -m window
|
||||||
;;
|
;;
|
||||||
$folder)
|
$folder)
|
||||||
~/.config/rofi/scripts/screenshot/screenshot_selection
|
~/.config/rofi/scripts/screenshot/screenshot_selection
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -4,25 +4,25 @@ screenshots_dir=$HOME/Pictures/Screenshots/PC
|
||||||
theme="$HOME/.config/rofi/scripts/wallpaper/style.rasi"
|
theme="$HOME/.config/rofi/scripts/wallpaper/style.rasi"
|
||||||
|
|
||||||
build_theme() {
|
build_theme() {
|
||||||
rows=$1
|
rows=$1
|
||||||
cols=$2
|
cols=$2
|
||||||
icon_size=$3
|
icon_size=$3
|
||||||
|
|
||||||
echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:$icon_size.0000em;}listview{lines:$rows;columns:$cols;}"
|
echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:$icon_size.0000em;}listview{lines:$rows;columns:$cols;}"
|
||||||
}
|
}
|
||||||
|
|
||||||
rofi_cmd="rofi -dmenu -i -show-icons -theme-str $(build_theme 5 4 10) -theme ${theme}"
|
rofi_cmd="rofi -dmenu -i -show-icons -theme-str $(build_theme 5 4 10) -theme ${theme}"
|
||||||
|
|
||||||
choice=$(
|
choice=$(
|
||||||
ls -t --escape "$screenshots_dir" -p | grep -v / |
|
ls -t --escape "$screenshots_dir" -p | grep -v / |
|
||||||
while read A; do echo -en "$A\x00icon\x1f$screenshots_dir/$A\n"; done |
|
while read A; do echo -en "$A\x00icon\x1f$screenshots_dir/$A\n"; done |
|
||||||
$rofi_cmd
|
$rofi_cmd
|
||||||
)
|
)
|
||||||
|
|
||||||
screenshot="$screenshots_dir/$choice"
|
screenshot="$screenshots_dir/$choice"
|
||||||
|
|
||||||
if command -v satty &>/dev/null; then
|
if command -v satty &>/dev/null; then
|
||||||
satty -f "$screenshot"
|
satty -f "$screenshot"
|
||||||
else
|
else
|
||||||
xdg-open "$screenshot"
|
xdg-open "$screenshot"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
wallpapers_dir="$HOME/.config/hypr/theme/walls/"
|
wallpapers_dir="$HOME/.config/hypr/theme/walls/"
|
||||||
|
|
||||||
build_theme() {
|
build_theme() {
|
||||||
rows=$1
|
rows=$1
|
||||||
cols=$2
|
cols=$2
|
||||||
icon_size=$3
|
icon_size=$3
|
||||||
|
|
||||||
echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:$icon_size.0000em;}listview{lines:$rows;columns:$cols;}"
|
echo "element{orientation:vertical;}element-text{horizontal-align:0.5;}element-icon{size:$icon_size.0000em;}listview{lines:$rows;columns:$cols;}"
|
||||||
}
|
}
|
||||||
|
|
||||||
theme="$HOME/.config/rofi/scripts/wallpaper/style.rasi"
|
theme="$HOME/.config/rofi/scripts/wallpaper/style.rasi"
|
||||||
|
@ -15,17 +15,17 @@ theme="$HOME/.config/rofi/scripts/wallpaper/style.rasi"
|
||||||
rofi_cmd="rofi -dmenu -i -show-icons -theme-str $(build_theme 4 3 12) -theme ${theme}"
|
rofi_cmd="rofi -dmenu -i -show-icons -theme-str $(build_theme 4 3 12) -theme ${theme}"
|
||||||
|
|
||||||
choice=$(
|
choice=$(
|
||||||
ls --escape "$wallpapers_dir" |
|
ls --escape "$wallpapers_dir" |
|
||||||
while read A; do echo -en "$A\x00icon\x1f$wallpapers_dir/$A\n"; done |
|
while read A; do echo -en "$A\x00icon\x1f$wallpapers_dir/$A\n"; done |
|
||||||
$rofi_cmd
|
$rofi_cmd
|
||||||
)
|
)
|
||||||
|
|
||||||
wallpaper="$wallpapers_dir/$choice"
|
wallpaper="$wallpapers_dir/$choice"
|
||||||
|
|
||||||
swww img "$wallpaper" \
|
swww img "$wallpaper" \
|
||||||
--transition-bezier 0.5,1.19,.8,.4 \
|
--transition-bezier 0.5,1.19,.8,.4 \
|
||||||
--transition-type wipe \
|
--transition-type wipe \
|
||||||
--transition-duration 2 \
|
--transition-duration 2 \
|
||||||
--transition-fps 75 && notify-send "Wallpaper Changed" -i "$wallpaper" --app-name=Wallpaper
|
--transition-fps 75 && notify-send "Wallpaper Changed" -i "$wallpaper" --app-name=Wallpaper
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue