30 changed files with 380 additions and 394 deletions
@ -1,51 +1,51 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||||
# Script for keyboard backlights (if supported) using brightnessctl |
# Script for keyboard backlights (if supported) using brightnessctl |
||||||
|
|
||||||
iDIR="$HOME/.config/swaync/icons" |
iDIR="$HOME/.config/swaync/icons" |
||||||
|
|
||||||
# Get keyboard brightness |
# Get keyboard brightness |
||||||
get_kbd_backlight() { |
get_kbd_backlight() { |
||||||
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4) |
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4) |
||||||
} |
} |
||||||
|
|
||||||
# Get icons |
# Get icons |
||||||
get_icon() { |
get_icon() { |
||||||
current=$(get_kbd_backlight | sed 's/%//') |
current=$(get_kbd_backlight | sed 's/%//') |
||||||
if [ "$current" -le "20" ]; then |
if [ "$current" -le "20" ]; then |
||||||
icon="$iDIR/brightness-20.png" |
icon="$iDIR/brightness-20.png" |
||||||
elif [ "$current" -le "40" ]; then |
elif [ "$current" -le "40" ]; then |
||||||
icon="$iDIR/brightness-40.png" |
icon="$iDIR/brightness-40.png" |
||||||
elif [ "$current" -le "60" ]; then |
elif [ "$current" -le "60" ]; then |
||||||
icon="$iDIR/brightness-60.png" |
icon="$iDIR/brightness-60.png" |
||||||
elif [ "$current" -le "80" ]; then |
elif [ "$current" -le "80" ]; then |
||||||
icon="$iDIR/brightness-80.png" |
icon="$iDIR/brightness-80.png" |
||||||
else |
else |
||||||
icon="$iDIR/brightness-100.png" |
icon="$iDIR/brightness-100.png" |
||||||
fi |
fi |
||||||
} |
} |
||||||
# Notify |
# Notify |
||||||
notify_user() { |
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 brightness |
||||||
change_kbd_backlight() { |
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 |
# Execute accordingly |
||||||
case "$1" in |
case "$1" in |
||||||
"--get") |
"--get") |
||||||
get_kbd_backlight |
get_kbd_backlight |
||||||
;; |
;; |
||||||
"--inc") |
"--inc") |
||||||
change_kbd_backlight "+30%" |
change_kbd_backlight "+30%" |
||||||
;; |
;; |
||||||
"--dec") |
"--dec") |
||||||
change_kbd_backlight "30%-" |
change_kbd_backlight "30%-" |
||||||
;; |
;; |
||||||
*) |
*) |
||||||
get_kbd_backlight |
get_kbd_backlight |
||||||
;; |
;; |
||||||
esac |
esac |
||||||
|
|||||||
@ -1,17 +1,17 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||||
## Script for changing blurs on the fly |
# Script for changing blurs on the fly |
||||||
|
|
||||||
notif="$HOME/.config/swaync/images/bell.png" |
notif="$HOME/.config/swaync/images/bell.png" |
||||||
|
|
||||||
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int") |
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int") |
||||||
|
|
||||||
if [ "${STATE}" == "2" ]; then |
if [ "${STATE}" == "2" ]; then |
||||||
hyprctl keyword decoration:blur:size 2 |
hyprctl keyword decoration:blur:size 2 |
||||||
hyprctl keyword decoration:blur:passes 1 |
hyprctl keyword decoration:blur:passes 1 |
||||||
notify-send -e -u low -i "$notif" "Less blur" |
notify-send -e -u low -i "$notif" "Less blur" |
||||||
else |
else |
||||||
hyprctl keyword decoration:blur:size 5 |
hyprctl keyword decoration:blur:size 5 |
||||||
hyprctl keyword decoration:blur:passes 2 |
hyprctl keyword decoration:blur:passes 2 |
||||||
notify-send -e -u low -i "$notif" "Normal blur" |
notify-send -e -u low -i "$notif" "Normal blur" |
||||||
fi |
fi |
||||||
|
|||||||
@ -1,7 +1,9 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||||
# For Swaylock |
# For Swaylock |
||||||
|
|
||||||
CONFIG="$HOME/.config/swaylock/config" |
CONFIG="$HOME/.config/swaylock/config" |
||||||
|
|
||||||
sleep 0.5s; swaylock --config ${CONFIG} & disown |
sleep 0.5s |
||||||
|
swaylock --config ${CONFIG} & |
||||||
|
disown |
||||||
|
|||||||
@ -1,21 +1,21 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # |
||||||
# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it |
# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it |
||||||
|
|
||||||
# Find all polkit-gnome executables in the Nix store |
# Find all polkit-gnome executables in the Nix store |
||||||
polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null) |
polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null) |
||||||
|
|
||||||
for polkit_gnome_path in $polkit_gnome_paths; do |
for polkit_gnome_path in $polkit_gnome_paths; do |
||||||
# Extract the directory containing the executable |
# Extract the directory containing the executable |
||||||
polkit_gnome_dir=$(dirname "$polkit_gnome_path") |
polkit_gnome_dir=$(dirname "$polkit_gnome_path") |
||||||
|
|
||||||
# Check if the executable is valid and exists |
# Check if the executable is valid and exists |
||||||
if [ -x "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" ]; then |
if [ -x "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" ]; then |
||||||
# Start the Polkit-GNOME Authentication Agent |
# Start the Polkit-GNOME Authentication Agent |
||||||
"$polkit_gnome_dir/polkit-gnome-authentication-agent-1" & |
"$polkit_gnome_dir/polkit-gnome-authentication-agent-1" & |
||||||
exit 0 |
exit 0 |
||||||
fi |
fi |
||||||
done |
done |
||||||
|
|
||||||
# If no valid executable is found, report an error |
# If no valid executable is found, report an error |
||||||
echo "No valid Polkit-GNOME Authentication Agent executable found." |
echo "No valid Polkit-GNOME Authentication Agent executable found." |
||||||
|
|||||||
@ -1,30 +1,30 @@ |
|||||||
#!/bin/bash |
#!/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 |
# This is for polkits, it will start from top and will stop if the top is executed |
||||||
|
|
||||||
# Polkit possible paths files to check |
# Polkit possible paths files to check |
||||||
polkit=( |
polkit=( |
||||||
"/usr/lib/polkit-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-kde-authentication-agent-1" |
||||||
"/usr/lib/polkit-gnome-authentication-agent-1" |
"/usr/lib/polkit-gnome-authentication-agent-1" |
||||||
"/usr/libexec/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/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1" |
||||||
"/usr/lib/policykit-1-gnome/polkit-gnome-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 |
# Loop through the list of files |
||||||
for file in "${polkit[@]}"; do |
for file in "${polkit[@]}"; do |
||||||
if [ -e "$file" ]; then |
if [ -e "$file" ]; then |
||||||
echo "File $file found, executing command..." |
echo "File $file found, executing command..." |
||||||
exec "$file" |
exec "$file" |
||||||
executed=true |
executed=true |
||||||
break |
break |
||||||
fi |
fi |
||||||
done |
done |
||||||
|
|
||||||
# If none of the files were found, you can add a fallback command here |
# If none of the files were found, you can add a fallback command here |
||||||
if [ "$executed" == false ]; then |
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 |
fi |
||||||
|
|||||||
Loading…
Reference in new issue