30 changed files with 380 additions and 394 deletions
@ -1,51 +1,51 @@
|
||||
#!/bin/bash |
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||
# Script for keyboard backlights (if supported) using brightnessctl |
||||
|
||||
iDIR="$HOME/.config/swaync/icons" |
||||
|
||||
# Get keyboard brightness |
||||
get_kbd_backlight() { |
||||
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4) |
||||
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4) |
||||
} |
||||
|
||||
# Get icons |
||||
get_icon() { |
||||
current=$(get_kbd_backlight | sed 's/%//') |
||||
if [ "$current" -le "20" ]; then |
||||
icon="$iDIR/brightness-20.png" |
||||
elif [ "$current" -le "40" ]; then |
||||
icon="$iDIR/brightness-40.png" |
||||
elif [ "$current" -le "60" ]; then |
||||
icon="$iDIR/brightness-60.png" |
||||
elif [ "$current" -le "80" ]; then |
||||
icon="$iDIR/brightness-80.png" |
||||
else |
||||
icon="$iDIR/brightness-100.png" |
||||
fi |
||||
current=$(get_kbd_backlight | sed 's/%//') |
||||
if [ "$current" -le "20" ]; then |
||||
icon="$iDIR/brightness-20.png" |
||||
elif [ "$current" -le "40" ]; then |
||||
icon="$iDIR/brightness-40.png" |
||||
elif [ "$current" -le "60" ]; then |
||||
icon="$iDIR/brightness-60.png" |
||||
elif [ "$current" -le "80" ]; then |
||||
icon="$iDIR/brightness-80.png" |
||||
else |
||||
icon="$iDIR/brightness-100.png" |
||||
fi |
||||
} |
||||
# Notify |
||||
notify_user() { |
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard Brightness : $current%" |
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard Brightness : $current%" |
||||
} |
||||
|
||||
# Change brightness |
||||
change_kbd_backlight() { |
||||
brightnessctl -d *::kbd_backlight set "$1" && get_icon && notify_user |
||||
brightnessctl -d *::kbd_backlight set "$1" && get_icon && notify_user |
||||
} |
||||
|
||||
# Execute accordingly |
||||
case "$1" in |
||||
"--get") |
||||
get_kbd_backlight |
||||
;; |
||||
"--inc") |
||||
change_kbd_backlight "+30%" |
||||
;; |
||||
"--dec") |
||||
change_kbd_backlight "30%-" |
||||
;; |
||||
*) |
||||
get_kbd_backlight |
||||
;; |
||||
"--get") |
||||
get_kbd_backlight |
||||
;; |
||||
"--inc") |
||||
change_kbd_backlight "+30%" |
||||
;; |
||||
"--dec") |
||||
change_kbd_backlight "30%-" |
||||
;; |
||||
*) |
||||
get_kbd_backlight |
||||
;; |
||||
esac |
||||
|
||||
@ -1,17 +1,17 @@
|
||||
#!/bin/bash |
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
||||
## Script for changing blurs on the fly |
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||
# Script for changing blurs on the fly |
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png" |
||||
|
||||
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int") |
||||
|
||||
if [ "${STATE}" == "2" ]; then |
||||
hyprctl keyword decoration:blur:size 2 |
||||
hyprctl keyword decoration:blur:passes 1 |
||||
notify-send -e -u low -i "$notif" "Less blur" |
||||
hyprctl keyword decoration:blur:size 2 |
||||
hyprctl keyword decoration:blur:passes 1 |
||||
notify-send -e -u low -i "$notif" "Less blur" |
||||
else |
||||
hyprctl keyword decoration:blur:size 5 |
||||
hyprctl keyword decoration:blur:passes 2 |
||||
notify-send -e -u low -i "$notif" "Normal blur" |
||||
hyprctl keyword decoration:blur:size 5 |
||||
hyprctl keyword decoration:blur:passes 2 |
||||
notify-send -e -u low -i "$notif" "Normal blur" |
||||
fi |
||||
|
||||
@ -1,7 +1,9 @@
|
||||
#!/bin/bash |
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||
# For Swaylock |
||||
|
||||
CONFIG="$HOME/.config/swaylock/config" |
||||
|
||||
sleep 0.5s; swaylock --config ${CONFIG} & disown |
||||
sleep 0.5s |
||||
swaylock --config ${CONFIG} & |
||||
disown |
||||
|
||||
@ -1,30 +1,30 @@
|
||||
#!/bin/bash |
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||
# This is for polkits, it will start from top and will stop if the top is executed |
||||
|
||||
# Polkit possible paths files to check |
||||
polkit=( |
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" |
||||
"/usr/lib/polkit-kde-authentication-agent-1" |
||||
"/usr/lib/polkit-gnome-authentication-agent-1" |
||||
"/usr/libexec/polkit-gnome-authentication-agent-1" |
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1" |
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" |
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" |
||||
"/usr/lib/polkit-kde-authentication-agent-1" |
||||
"/usr/lib/polkit-gnome-authentication-agent-1" |
||||
"/usr/libexec/polkit-gnome-authentication-agent-1" |
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1" |
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" |
||||
) |
||||
|
||||
executed=false # Flag to track if a file has been executed |
||||
executed=false # Flag to track if a file has been executed |
||||
|
||||
# Loop through the list of files |
||||
for file in "${polkit[@]}"; do |
||||
if [ -e "$file" ]; then |
||||
echo "File $file found, executing command..." |
||||
exec "$file" |
||||
executed=true |
||||
break |
||||
fi |
||||
if [ -e "$file" ]; then |
||||
echo "File $file found, executing command..." |
||||
exec "$file" |
||||
executed=true |
||||
break |
||||
fi |
||||
done |
||||
|
||||
# If none of the files were found, you can add a fallback command here |
||||
if [ "$executed" == false ]; then |
||||
echo "None of the specified files were found. Install a Polkit" |
||||
echo "None of the specified files were found. Install a Polkit" |
||||
fi |
||||
|
||||
Loading…
Reference in new issue