Browse Source

Fix comment

pull/173/head
RyuuyaS 2 years ago
parent
commit
d77aec4b16
  1. 2
      config/hypr/UserScripts/Sounds.sh
  2. 28
      config/hypr/UserScripts/WallpaperAutoChange.sh
  3. 8
      config/hypr/UserScripts/WallpaperRandom.sh
  4. 84
      config/hypr/UserScripts/WallpaperSelect.sh
  5. 2
      config/hypr/scripts/AirplaneMode.sh
  6. 56
      config/hypr/scripts/Brightness.sh
  7. 56
      config/hypr/scripts/BrightnessKbd.sh
  8. 16
      config/hypr/scripts/ChangeBlur.sh
  9. 34
      config/hypr/scripts/ChangeLayout.sh
  10. 39
      config/hypr/scripts/ClipManager.sh
  11. 17
      config/hypr/scripts/DarkLight.sh
  12. 15
      config/hypr/scripts/GameMode.sh
  13. 67
      config/hypr/scripts/KeyHints.sh
  14. 6
      config/hypr/scripts/LockScreen.sh
  15. 34
      config/hypr/scripts/MediaCtrl.sh
  16. 18
      config/hypr/scripts/Polkit-NixOS.sh
  17. 30
      config/hypr/scripts/Polkit.sh
  18. 3
      config/hypr/scripts/PortalHyprland.sh
  19. 6
      config/hypr/scripts/PywalSwww.sh
  20. 8
      config/hypr/scripts/Refresh.sh
  21. 6
      config/hypr/scripts/RefreshNoWaybar.sh
  22. 4
      config/hypr/scripts/RofiEmoji.sh
  23. 87
      config/hypr/scripts/ScreenShot.sh
  24. 28
      config/hypr/scripts/SwitchKeyboardLayout.sh
  25. 20
      config/hypr/scripts/TouchPad.sh
  26. 42
      config/hypr/scripts/Volume.sh
  27. 2
      config/hypr/scripts/WaybarCava.sh
  28. 16
      config/hypr/scripts/WaybarLayout.sh
  29. 4
      config/hypr/scripts/WaybarStyles.sh
  30. 4
      config/hypr/scripts/Wlogout.sh

2
config/hypr/UserScripts/Sounds.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# This script is used to play system sounds. # This script is used to play system sounds.
theme="freedesktop" # Set the theme for the system sounds. theme="freedesktop" # Set the theme for the system sounds.

28
config/hypr/UserScripts/WallpaperAutoChange.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes # source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes
# This script will randomly go through the files of a directory, setting it # This script will randomly go through the files of a directory, setting it
@ -9,10 +9,10 @@
pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh
if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
echo "Usage: echo "Usage:
$0 <dir containing images>" $0 <dir containing images>"
exit 1 exit 1
fi fi
# Edit below to control the images transition # Edit below to control the images transition
@ -23,15 +23,15 @@ export SWWW_TRANSITION_TYPE=simple
INTERVAL=1800 INTERVAL=1800
while true; do while true; do
find "$1" \ find "$1" |
| while read -r img; do while read -r img; do
echo "$((RANDOM % 1000)):$img" echo "$((RANDOM % 1000)):$img"
done \ done |
| sort -n | cut -d':' -f2- \ sort -n | cut -d':' -f2- |
| while read -r img; do while read -r img; do
swww img "$img" swww img "$img"
$pywal_refresh $pywal_refresh
sleep $INTERVAL sleep $INTERVAL
done done
done done

8
config/hypr/UserScripts/WallpaperRandom.sh

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Script for Random Wallpaper ( CTRL ALT W) # Script for Random Wallpaper ( CTRL ALT W)
wallDIR="$HOME/Pictures/wallpapers" wallDIR="$HOME/Pictures/wallpapers"
scriptsDir="$HOME/.config/hypr/scripts" scriptsDir="$HOME/.config/hypr/scripts"
PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \)))
RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]}
# Transition config # Transition config
FPS=60 FPS=60
@ -16,11 +15,8 @@ DURATION=1
BEZIER=".43,1.19,1,.4" BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS
${scriptsDir}/PywalSwww.sh ${scriptsDir}/PywalSwww.sh
sleep 1 sleep 1
${scriptsDir}/Refresh.sh ${scriptsDir}/Refresh.sh

84
config/hypr/UserScripts/WallpaperSelect.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# This script for selecting wallpapers (SUPER W) # This script for selecting wallpapers (SUPER W)
SCRIPTSDIR="$HOME/.config/hypr/scripts" SCRIPTSDIR="$HOME/.config/hypr/scripts"
@ -15,8 +15,8 @@ BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION" SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
# Check if swaybg is running # Check if swaybg is running
if pidof swaybg > /dev/null; then if pidof swaybg >/dev/null; then
pkill swaybg pkill swaybg
fi fi
# Retrieve image files # Retrieve image files
@ -28,56 +28,56 @@ RANDOM_PIC_NAME="${#PICS[@]}. random"
rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi" rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi"
menu() { menu() {
for i in "${!PICS[@]}"; do for i in "${!PICS[@]}"; do
# Displaying .gif to indicate animated images # Displaying .gif to indicate animated images
if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then
printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${wallDIR}/${PICS[$i]}\n" printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${wallDIR}/${PICS[$i]}\n"
else else
printf "${PICS[$i]}\n" printf "${PICS[$i]}\n"
fi fi
done done
printf "$RANDOM_PIC_NAME\n" printf "$RANDOM_PIC_NAME\n"
} }
swww query || swww init swww query || swww init
main() { main() {
choice=$(menu | ${rofi_command}) choice=$(menu | ${rofi_command})
# No choice case # No choice case
if [[ -z $choice ]]; then if [[ -z $choice ]]; then
exit 0 exit 0
fi fi
# Random choice case # Random choice case
if [ "$choice" = "$RANDOM_PIC_NAME" ]; then if [ "$choice" = "$RANDOM_PIC_NAME" ]; then
swww img "${wallDIR}/${RANDOM_PIC}" $SWWW_PARAMS swww img "${wallDIR}/${RANDOM_PIC}" $SWWW_PARAMS
exit 0 exit 0
fi fi
# Find the index of the selected file # Find the index of the selected file
pic_index=-1 pic_index=-1
for i in "${!PICS[@]}"; do for i in "${!PICS[@]}"; do
filename=$(basename "${PICS[$i]}") filename=$(basename "${PICS[$i]}")
if [[ "$filename" == "$choice"* ]]; then if [[ "$filename" == "$choice"* ]]; then
pic_index=$i pic_index=$i
break break
fi
done
if [[ $pic_index -ne -1 ]]; then
swww img "${wallDIR}/${PICS[$pic_index]}" $SWWW_PARAMS
else
echo "Image not found."
exit 1
fi fi
done
if [[ $pic_index -ne -1 ]]; then
swww img "${wallDIR}/${PICS[$pic_index]}" $SWWW_PARAMS
else
echo "Image not found."
exit 1
fi
} }
# Check if rofi is already running # Check if rofi is already running
if pidof rofi > /dev/null; then if pidof rofi >/dev/null; then
pkill rofi pkill rofi
exit 0 exit 0
fi fi
main main

2
config/hypr/scripts/AirplaneMode.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Airplane Mode. Turning on or off all wifi using rfkill. # Airplane Mode. Turning on or off all wifi using rfkill.
notif="$HOME/.config/swaync/images/bell.png" notif="$HOME/.config/swaync/images/bell.png"

56
config/hypr/scripts/Brightness.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Script for Monitor backlights (if supported) using brightnessctl # Script for Monitor backlights (if supported) using brightnessctl
iDIR="$HOME/.config/swaync/icons" iDIR="$HOME/.config/swaync/icons"
@ -7,47 +7,47 @@ notification_timeout=1000
# Get brightness # Get brightness
get_backlight() { get_backlight() {
echo $(brightnessctl -m | cut -d, -f4) echo $(brightnessctl -m | cut -d, -f4)
} }
# Get icons # Get icons
get_icon() { get_icon() {
current=$(get_backlight | sed 's/%//') current=$(get_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" "Brightness : $current%" notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Brightness : $current%"
} }
# Change brightness # Change brightness
change_backlight() { change_backlight() {
brightnessctl set "$1" && get_icon && notify_user brightnessctl set "$1" && get_icon && notify_user
} }
# Execute accordingly # Execute accordingly
case "$1" in case "$1" in
"--get") "--get")
get_backlight get_backlight
;; ;;
"--inc") "--inc")
change_backlight "+10%" change_backlight "+10%"
;; ;;
"--dec") "--dec")
change_backlight "10%-" change_backlight "10%-"
;; ;;
*) *)
get_backlight get_backlight
;; ;;
esac esac

56
config/hypr/scripts/BrightnessKbd.sh

@ -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

16
config/hypr/scripts/ChangeBlur.sh

@ -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

34
config/hypr/scripts/ChangeLayout.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# for changing Hyprland Layouts (Master or Dwindle) on the fly # for changing Hyprland Layouts (Master or Dwindle) on the fly
notif="$HOME/.config/swaync/images/bell.png" notif="$HOME/.config/swaync/images/bell.png"
@ -8,23 +8,23 @@ LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g')
case $LAYOUT in case $LAYOUT in
"master") "master")
hyprctl keyword general:layout dwindle hyprctl keyword general:layout dwindle
hyprctl keyword unbind SUPER,J hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K hyprctl keyword unbind SUPER,K
hyprctl keyword bind SUPER,J,cyclenext hyprctl keyword bind SUPER,J,cyclenext
hyprctl keyword bind SUPER,K,cyclenext,prev hyprctl keyword bind SUPER,K,cyclenext,prev
hyprctl keyword bind SUPER,O,togglesplit hyprctl keyword bind SUPER,O,togglesplit
notify-send -e -u low -i "$notif" "Dwindle Layout" notify-send -e -u low -i "$notif" "Dwindle Layout"
;; ;;
"dwindle") "dwindle")
hyprctl keyword general:layout master hyprctl keyword general:layout master
hyprctl keyword unbind SUPER,J hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K hyprctl keyword unbind SUPER,K
hyprctl keyword unbind SUPER,O hyprctl keyword unbind SUPER,O
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
notify-send -e -u low -i "$notif" "Master Layout" notify-send -e -u low -i "$notif" "Master Layout"
;; ;;
*) ;; *) ;;
esac esac

39
config/hypr/scripts/ClipManager.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy. # Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
# Actions: # Actions:
@ -15,26 +15,25 @@ while true; do
) )
case "$?" in case "$?" in
1) 1)
exit exit
;; ;;
0) 0)
case "$result" in case "$result" in
"") "")
continue continue
;;
*)
cliphist decode <<<"$result" | wl-copy
exit
;;
esac
;;
10)
cliphist delete <<<"$result"
;; ;;
11) *)
cliphist wipe cliphist decode <<<"$result" | wl-copy
exit
;; ;;
esac
;;
10)
cliphist delete <<<"$result"
;;
11)
cliphist wipe
;;
esac esac
done done

17
config/hypr/scripts/DarkLight.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# For Dark and Light switching # For Dark and Light switching
# Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate folders # Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate folders
@ -36,7 +36,7 @@ fi
# Function to update theme mode for the next cycle # Function to update theme mode for the next cycle
update_theme_mode() { update_theme_mode() {
echo "$next_mode" > ~/.cache/.theme_mode echo "$next_mode" >~/.cache/.theme_mode
} }
# Function to notify user # Function to notify user
@ -64,14 +64,13 @@ set_waybar_style() {
set_waybar_style "$next_mode" set_waybar_style "$next_mode"
notify_user "$next_mode" notify_user "$next_mode"
# swaync color change # swaync color change
if [ "$next_mode" = "Dark" ]; then if [ "$next_mode" = "Dark" ]; then
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.8);/' "${swaync_style}" sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.8);/' "${swaync_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${swaync_style}" sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${swaync_style}"
else else
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.9);/' "${swaync_style}" sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.9);/' "${swaync_style}"
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${swaync_style}" sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${swaync_style}"
fi fi
# Set Dynamic Wallpaper for Dark or Light Mode # Set Dynamic Wallpaper for Dark or Light Mode
@ -84,7 +83,6 @@ fi
# Update wallpaper using swww command # Update wallpaper using swww command
$swww "${next_wallpaper}" $effect $swww "${next_wallpaper}" $effect
# Set Kvantum Manager theme & QT5/QT6 settings # Set Kvantum Manager theme & QT5/QT6 settings
if [ "$next_mode" = "Dark" ]; then if [ "$next_mode" = "Dark" ]; then
kvantum_theme="Tokyo-Night" kvantum_theme="Tokyo-Night"
@ -148,7 +146,7 @@ set_custom_gtk_theme() {
gsettings set $theme_setting "$selected_theme" gsettings set $theme_setting "$selected_theme"
# Flatpak GTK apps (themes) # Flatpak GTK apps (themes)
if command -v flatpak &> /dev/null; then if command -v flatpak &>/dev/null; then
flatpak --user override --filesystem=$HOME/.themes flatpak --user override --filesystem=$HOME/.themes
sleep 0.5 sleep 0.5
flatpak --user override --env=GTK_THEME="$selected_theme" flatpak --user override --env=GTK_THEME="$selected_theme"
@ -166,12 +164,12 @@ set_custom_gtk_theme() {
echo "Selected icon theme for $mode mode: $selected_icon" echo "Selected icon theme for $mode mode: $selected_icon"
gsettings set $icon_setting "$selected_icon" gsettings set $icon_setting "$selected_icon"
## QT5ct icon_theme # QT5ct icon_theme
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt5ct/qt5ct.conf" sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt5ct/qt5ct.conf"
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt6ct/qt6ct.conf" sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt6ct/qt6ct.conf"
# Flatpak GTK apps (icons) # Flatpak GTK apps (icons)
if command -v flatpak &> /dev/null; then if command -v flatpak &>/dev/null; then
flatpak --user override --filesystem=$HOME/.icons flatpak --user override --filesystem=$HOME/.icons
sleep 0.5 sleep 0.5
flatpak --user override --env=ICON_THEME="$selected_icon" flatpak --user override --env=ICON_THEME="$selected_icon"
@ -197,4 +195,3 @@ ${SCRIPTSDIR}/Refresh.sh
notify-send -u normal -i "$notif" "Themes in $next_mode Mode" notify-send -u normal -i "$notif" "Themes in $next_mode Mode"
exit 0 exit 0

15
config/hypr/scripts/GameMode.sh

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Game Mode. Turning off all animations # Game Mode. Turning off all animations
notif="$HOME/.config/swaync/images/bell.png" notif="$HOME/.config/swaync/images/bell.png"
SCRIPTSDIR="$HOME/.config/hypr/scripts" SCRIPTSDIR="$HOME/.config/hypr/scripts"
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}') HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ] ; then if [ "$HYPRGAMEMODE" = 1 ]; then
hyprctl --batch "\ hyprctl --batch "\
keyword animations:enabled 0;\ keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\ keyword decoration:drop_shadow 0;\
@ -20,11 +19,11 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then
notify-send -e -u low -i "$notif" "gamemode enabled. All animations off" notify-send -e -u low -i "$notif" "gamemode enabled. All animations off"
exit exit
else else
swww init && swww img "$HOME/.config/rofi/.current_wallpaper" swww init && swww img "$HOME/.config/rofi/.current_wallpaper"
sleep 0.1 sleep 0.1
${SCRIPTSDIR}/PywalSwww.sh ${SCRIPTSDIR}/PywalSwww.sh
sleep 0.5 sleep 0.5
${SCRIPTSDIR}/Refresh.sh ${SCRIPTSDIR}/Refresh.sh
notify-send -e -u normal -i "$notif" "gamemode disabled. All animations normal" notify-send -e -u normal -i "$notif" "gamemode disabled. All animations normal"
exit exit
fi fi

67
config/hypr/scripts/KeyHints.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Keyhints. Idea got from Garuda Hyprland # Keyhints. Idea got from Garuda Hyprland
# Detect monitor resolution and scale # Detect monitor resolution and scale
@ -37,37 +37,34 @@ yad --width=$dynamic_width --height=$dynamic_height \
--column=Description: \ --column=Description: \
--column=Command: \ --column=Command: \
--timeout-indicator=bottom \ --timeout-indicator=bottom \
"ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \ "ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \
" enter" "Terminal" "(kitty)" \ " enter" "Terminal" "(kitty)" \
" or D" "App Launcher" "(rofi)" \ " or D" "App Launcher" "(rofi)" \
" T" "Open File Manager" "(Thunar)" \ " T" "Open File Manager" "(Thunar)" \
" Q" "close active window" "(not kill)" \ " Q" "close active window" "(not kill)" \
" Shift Q " "closes a specified window" "(window)" \ " Shift Q " "closes a specified window" "(window)" \
" Alt V" "Clipboard Manager" "(cliphist)" \ " Alt V" "Clipboard Manager" "(cliphist)" \
" W" "Choose wallpaper" "(Wallpaper Menu)" \ " W" "Choose wallpaper" "(Wallpaper Menu)" \
"CTRL ALT W" "Random wallpaper" "(via swww)" \ "CTRL ALT W" "Random wallpaper" "(via swww)" \
" B" "Hide/UnHide Waybar" "waybar" \ " B" "Hide/UnHide Waybar" "waybar" \
" CTRL B" "Choose waybar styles" "(waybar styles)" \ " CTRL B" "Choose waybar styles" "(waybar styles)" \
" ALT B" "Choose waybar layout" "(waybar layout)" \ " ALT B" "Choose waybar layout" "(waybar layout)" \
" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \ " ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \
" SHIFT N" "Launch Notification Panel" "swaync Notification Center" \ " SHIFT N" "Launch Notification Panel" "swaync Notification Center" \
" Print" "screenshot" "(grim)" \ " Print" "screenshot" "(grim)" \
" Shift Print" "screenshot region" "(grim + slurp)" \ " Shift Print" "screenshot region" "(grim + slurp)" \
" Shift S" "screenshot region" "(swappy)" \ " Shift S" "screenshot region" "(swappy)" \
"ALT Print" "Screenshot active window" "active window only" \ "ALT Print" "Screenshot active window" "active window only" \
"CTRL ALT P" "power-menu" "(wlogout)" \ "CTRL ALT P" "power-menu" "(wlogout)" \
"CTRL ALT L" "screen lock" "(swaylock)" \ "CTRL ALT L" "screen lock" "(swaylock)" \
"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ "CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \
" F" "Fullscreen" "Toggles to full screen" \ " F" "Fullscreen" "Toggles to full screen" \
" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ " ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \
" Shift F" "Toggle float" "single window" \ " Shift F" "Toggle float" "single window" \
" ALT F" "Toggle all windows to float" "all windows" \ " ALT F" "Toggle all windows to float" "all windows" \
" Shift B" "Toggle Blur" "normal or less blur" \ " Shift B" "Toggle Blur" "normal or less blur" \
" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \ " SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \
" H" "Launch this app" "" \ " H" "Launch this app" "" \
" E" "View or EDIT Keybinds, Settings, Monitor" "" \ " E" "View or EDIT Keybinds, Settings, Monitor" "" \
"" "" "" \ "" "" "" \
"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\ "More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""

6
config/hypr/scripts/LockScreen.sh

@ -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

34
config/hypr/scripts/MediaCtrl.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Playerctl # Playerctl
music_icon="$HOME/.config/swaync/icons/music.png" music_icon="$HOME/.config/swaync/icons/music.png"
@ -42,20 +42,20 @@ show_music_notification() {
# Get media control action from command line argument # Get media control action from command line argument
case "$1" in case "$1" in
"--nxt") "--nxt")
play_next play_next
;; ;;
"--prv") "--prv")
play_previous play_previous
;; ;;
"--pause") "--pause")
toggle_play_pause toggle_play_pause
;; ;;
"--stop") "--stop")
stop_playback stop_playback
;; ;;
*) *)
echo "Usage: $0 [--nxt|--prv|--pause|--stop]" echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
exit 1 exit 1
;; ;;
esac esac

18
config/hypr/scripts/Polkit-NixOS.sh

@ -1,20 +1,20 @@
#!/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

30
config/hypr/scripts/Polkit.sh

@ -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

3
config/hypr/scripts/PortalHyprland.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# For manually starting xdg-desktop-portal # For manually starting xdg-desktop-portal
sleep 1 sleep 1
@ -13,4 +13,3 @@ sleep 1
sleep 2 sleep 2
/usr/lib/xdg-desktop-portal-hyprland & /usr/lib/xdg-desktop-portal-hyprland &
/usr/libexec/xdg-desktop-portal & /usr/libexec/xdg-desktop-portal &

6
config/hypr/scripts/PywalSwww.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Pywal Colors for current wallpaper # Pywal Colors for current wallpaper
# Define the path to the swww cache directory # Define the path to the swww cache directory
@ -24,7 +24,7 @@ if [ -f "$cache_file" ]; then
echo $wallpaper_path echo $wallpaper_path
# Copy the wallpaper to the location Rofi can access # Copy the wallpaper to the location Rofi can access
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
ln_success=true # Set the flag to true upon successful execution ln_success=true # Set the flag to true upon successful execution
fi fi
fi fi
@ -32,7 +32,7 @@ fi
if [ "$ln_success" = true ]; then if [ "$ln_success" = true ]; then
# execute pywal # execute pywal
# wal -i "$wallpaper_path" # wal -i "$wallpaper_path"
echo 'about to execute wal' echo 'about to execute wal'
# execute pywal skipping tty and terminal changes # execute pywal skipping tty and terminal changes
wal -i "$wallpaper_path" -s -t & wal -i "$wallpaper_path" -s -t &
fi fi

8
config/hypr/scripts/Refresh.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Scripts for refreshing waybar, rofi, swaync, pywal colors # Scripts for refreshing waybar, rofi, swaync, pywal colors
SCRIPTSDIR=$HOME/.config/hypr/scripts SCRIPTSDIR=$HOME/.config/hypr/scripts
@ -8,9 +8,9 @@ UserScripts=$HOME/.config/hypr/UserScripts
# Define file_exists function # Define file_exists function
file_exists() { file_exists() {
if [ -e "$1" ]; then if [ -e "$1" ]; then
return 0 # File exists return 0 # File exists
else else
return 1 # File does not exist return 1 # File does not exist
fi fi
} }
@ -28,7 +28,7 @@ waybar &
# relaunch swaync # relaunch swaync
sleep 0.5 sleep 0.5
swaync > /dev/null 2>&1 & swaync >/dev/null 2>&1 &
# Relaunching rainbow borders if the script exists # Relaunching rainbow borders if the script exists
sleep 1 sleep 1

6
config/hypr/scripts/RefreshNoWaybar.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Modified version of Refresh but no waybar refresh # Modified version of Refresh but no waybar refresh
# Used by automatic wallpaper change # Used by automatic wallpaper change
@ -11,9 +11,9 @@ UserScripts=$HOME/.config/hypr/UserScripts
# Define file_exists function # Define file_exists function
file_exists() { file_exists() {
if [ -e "$1" ]; then if [ -e "$1" ]; then
return 0 # File exists return 0 # File exists
else else
return 1 # File does not exist return 1 # File does not exist
fi fi
} }

4
config/hypr/scripts/RofiEmoji.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Rofi Emoticons. Not my own. Cant remember the source # Rofi Emoticons. Not my own. Cant remember the source
sed '1,/^### DATA ###$/d' $0 | sed '1,/^### DATA ###$/d' $0 |
@ -7,7 +7,7 @@ rofi -dmenu -config ~/.config/rofi/config-long.rasi|
cut -d ' ' -f 1 | tr -d '\n' | wl-copy cut -d ' ' -f 1 | tr -d '\n' | wl-copy
exit exit
### DATA ### # ### DATA ###
😀 grinning face face smile happy joy :D grin 😀 grinning face face smile happy joy :D grin
😃 grinning face with big eyes face happy joy haha :D :) smile funny 😃 grinning face with big eyes face happy joy haha :D :) smile funny
😄 grinning face with smiling eyes face happy joy funny haha laugh like :D :) smile 😄 grinning face with smiling eyes face happy joy funny haha laugh like :D :) smile

87
config/hypr/scripts/ScreenShot.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Screenshots scripts # Screenshots scripts
iDIR="$HOME/.config/swaync/icons" iDIR="$HOME/.config/swaync/icons"
@ -24,7 +24,7 @@ notify_view() {
${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved" ${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved"
fi fi
elif [[ "$1" == "swappy" ]]; then elif [[ "$1" == "swappy" ]]; then
${notify_cmd_shot} "Screenshot Captured." ${notify_cmd_shot} "Screenshot Captured."
else else
local check_file="$dir/$file" local check_file="$dir/$file"
if [[ -e "$check_file" ]]; then if [[ -e "$check_file" ]]; then
@ -36,53 +36,51 @@ notify_view() {
fi fi
} }
# countdown # countdown
countdown() { countdown() {
for sec in $(seq $1 -1 1); do for sec in $(seq $1 -1 1); do
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec" notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec"
sleep 1 sleep 1
done done
} }
# take shots # take shots
shotnow() { shotnow() {
cd ${dir} && grim - | tee "$file" | wl-copy cd ${dir} && grim - | tee "$file" | wl-copy
sleep 2 sleep 2
notify_view notify_view
} }
shot5() { shot5() {
countdown '5' countdown '5'
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
sleep 1 sleep 1
notify_view notify_view
} }
shot10() { shot10() {
countdown '10' countdown '10'
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
notify_view notify_view
} }
shotwin() { shotwin() {
w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1) w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1)
w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g) w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g)
cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy
notify_view notify_view
} }
shotarea() { shotarea() {
tmpfile=$(mktemp) tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile" grim -g "$(slurp)" - >"$tmpfile"
if [[ -s "$tmpfile" ]]; then if [[ -s "$tmpfile" ]]; then
wl-copy <"$tmpfile" wl-copy <"$tmpfile"
mv "$tmpfile" "$dir/$file" mv "$tmpfile" "$dir/$file"
fi fi
rm "$tmpfile" rm "$tmpfile"
notify_view notify_view
} }
shotactive() { shotactive() {
@ -91,38 +89,37 @@ shotactive() {
active_window_path="${dir}/${active_window_file}" active_window_path="${dir}/${active_window_file}"
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}" hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}"
sleep 1 sleep 1
notify_view "active" notify_view "active"
} }
shotswappy() { shotswappy() {
tmpfile=$(mktemp) tmpfile=$(mktemp)
grim -g "$(slurp)" - >"$tmpfile" && "${sDIR}/Sounds.sh" --screenshot && notify_view "swappy" grim -g "$(slurp)" - >"$tmpfile" && "${sDIR}/Sounds.sh" --screenshot && notify_view "swappy"
swappy -f - <"$tmpfile" swappy -f - <"$tmpfile"
rm "$tmpfile" rm "$tmpfile"
} }
if [[ ! -d "$dir" ]]; then if [[ ! -d "$dir" ]]; then
mkdir -p "$dir" mkdir -p "$dir"
fi fi
if [[ "$1" == "--now" ]]; then if [[ "$1" == "--now" ]]; then
shotnow shotnow
elif [[ "$1" == "--in5" ]]; then elif [[ "$1" == "--in5" ]]; then
shot5 shot5
elif [[ "$1" == "--in10" ]]; then elif [[ "$1" == "--in10" ]]; then
shot10 shot10
elif [[ "$1" == "--win" ]]; then elif [[ "$1" == "--win" ]]; then
shotwin shotwin
elif [[ "$1" == "--area" ]]; then elif [[ "$1" == "--area" ]]; then
shotarea shotarea
elif [[ "$1" == "--active" ]]; then elif [[ "$1" == "--active" ]]; then
shotactive shotactive
elif [[ "$1" == "--swappy" ]]; then elif [[ "$1" == "--swappy" ]]; then
shotswappy shotswappy
else else
echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy" echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
fi fi
exit 0 exit 0

28
config/hypr/scripts/SwitchKeyboardLayout.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# This is for changing kb_layouts. Set kb_layouts in $settings_file # This is for changing kb_layouts. Set kb_layouts in $settings_file
layout_f="$HOME/.cache/kb_layout" layout_f="$HOME/.cache/kb_layout"
@ -8,38 +8,38 @@ notif="$HOME/.config/swaync/images/bell.png"
# Check if ~/.cache/kb_layout exists and create it with a default layout from Settings.conf if not found # Check if ~/.cache/kb_layout exists and create it with a default layout from Settings.conf if not found
if [ ! -f "$layout_f" ]; then if [ ! -f "$layout_f" ]; then
default_layout=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2 | cut -d ',' -f 1 2>/dev/null) default_layout=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2 | cut -d ',' -f 1 2>/dev/null)
if [ -z "$default_layout" ]; then if [ -z "$default_layout" ]; then
default_layout="us" # Default to 'us' layout if Settings.conf or 'kb_layout' is not found default_layout="us" # Default to 'us' layout if Settings.conf or 'kb_layout' is not found
fi fi
echo "$default_layout" > "$layout_f" echo "$default_layout" >"$layout_f"
fi fi
current_layout=$(cat "$layout_f") current_layout=$(cat "$layout_f")
# Read keyboard layout settings from Settings.conf # Read keyboard layout settings from Settings.conf
if [ -f "$settings_file" ]; then if [ -f "$settings_file" ]; then
kb_layout_line=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2) kb_layout_line=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2)
IFS=',' read -ra layout_mapping <<< "$kb_layout_line" IFS=',' read -ra layout_mapping <<<"$kb_layout_line"
fi fi
layout_count=${#layout_mapping[@]} layout_count=${#layout_mapping[@]}
# Find the index of the current layout in the mapping # Find the index of the current layout in the mapping
for ((i = 0; i < layout_count; i++)); do for ((i = 0; i < layout_count; i++)); do
if [ "$current_layout" == "${layout_mapping[i]}" ]; then if [ "$current_layout" == "${layout_mapping[i]}" ]; then
current_index=$i current_index=$i
break break
fi fi
done done
# Calculate the index of the next layout # Calculate the index of the next layout
next_index=$(( (current_index + 1) % layout_count )) next_index=$(((current_index + 1) % layout_count))
new_layout="${layout_mapping[next_index]}" new_layout="${layout_mapping[next_index]}"
# Update the keyboard layout # Update the keyboard layout
hyprctl keyword input:kb_layout "$new_layout" hyprctl keyword input:kb_layout "$new_layout"
echo "$new_layout" > "$layout_f" echo "$new_layout" >"$layout_f"
# Notification for the new keyboard layout # Notification for the new keyboard layout
notify-send -u low -i "$notif" "new KB_Layout: $new_layout" notify-send -u low -i "$notif" "new KB_Layout: $new_layout"

20
config/hypr/scripts/TouchPad.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# For disabling touchpad. # For disabling touchpad.
Touchpad_Device="asue1209:00-04f3:319f-touchpad" Touchpad_Device="asue1209:00-04f3:319f-touchpad"
@ -9,16 +9,16 @@ XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
toggle_touchpad() { toggle_touchpad() {
if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then
echo "true" > "$STATUS_FILE" echo "true" >"$STATUS_FILE"
action="enabled" action="enabled"
else else
echo "false" > "$STATUS_FILE" echo "false" >"$STATUS_FILE"
action="disabled" action="disabled"
fi fi
notify-send -u low -i "$notif" "Touchpad $action" notify-send -u low -i "$notif" "Touchpad $action"
hyprctl keyword "device:$Touchpad_Device:enabled" "$(cat "$STATUS_FILE")" hyprctl keyword "device:$Touchpad_Device:enabled" "$(cat "$STATUS_FILE")"
} }
toggle_touchpad toggle_touchpad

42
config/hypr/scripts/Volume.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Scripts for volume controls for audio and mic # Scripts for volume controls for audio and mic
iDIR="$HOME/.config/swaync/icons" iDIR="$HOME/.config/swaync/icons"
@ -57,20 +57,20 @@ dec_volume() {
# Toggle Mute # Toggle Mute
toggle_mute() { toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then if [ "$(pamixer --get-mute)" == "false" ]; then
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF" pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "Volume Switched OFF"
elif [ "$(pamixer --get-mute)" == "true" ]; then elif [ "$(pamixer --get-mute)" == "true" ]; then
pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON" pamixer -u && notify-send -e -u low -i "$(get_icon)" "Volume Switched ON"
fi fi
} }
# Toggle Mic # Toggle Mic
toggle_mic() { toggle_mic() {
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF" pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON" pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "Microphone Switched ON"
fi fi
} }
# Get Mic Icon # Get Mic Icon
get_mic_icon() { get_mic_icon() {
@ -117,23 +117,23 @@ dec_mic_volume() {
# Execute accordingly # Execute accordingly
if [[ "$1" == "--get" ]]; then if [[ "$1" == "--get" ]]; then
get_volume get_volume
elif [[ "$1" == "--inc" ]]; then elif [[ "$1" == "--inc" ]]; then
inc_volume inc_volume
elif [[ "$1" == "--dec" ]]; then elif [[ "$1" == "--dec" ]]; then
dec_volume dec_volume
elif [[ "$1" == "--toggle" ]]; then elif [[ "$1" == "--toggle" ]]; then
toggle_mute toggle_mute
elif [[ "$1" == "--toggle-mic" ]]; then elif [[ "$1" == "--toggle-mic" ]]; then
toggle_mic toggle_mic
elif [[ "$1" == "--get-icon" ]]; then elif [[ "$1" == "--get-icon" ]]; then
get_icon get_icon
elif [[ "$1" == "--get-mic-icon" ]]; then elif [[ "$1" == "--get-mic-icon" ]]; then
get_mic_icon get_mic_icon
elif [[ "$1" == "--mic-inc" ]]; then elif [[ "$1" == "--mic-inc" ]]; then
inc_mic_volume inc_mic_volume
elif [[ "$1" == "--mic-dec" ]]; then elif [[ "$1" == "--mic-dec" ]]; then
dec_mic_volume dec_mic_volume
else else
get_volume get_volume
fi fi

2
config/hypr/scripts/WaybarCava.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Not my own work. This was added through Github PR. Credit to original author # Not my own work. This was added through Github PR. Credit to original author

16
config/hypr/scripts/WaybarLayout.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Script for waybar layout or configs # Script for waybar layout or configs
set -euo pipefail set -euo pipefail
@ -31,7 +31,7 @@ apply_config() {
restart_waybar_if_needed() { restart_waybar_if_needed() {
if pgrep -x "waybar" >/dev/null; then if pgrep -x "waybar" >/dev/null; then
pkill waybar pkill waybar
sleep 0.1 # Delay for Waybar to completely terminate sleep 0.1 # Delay for Waybar to completely terminate
fi fi
"${SCRIPTSDIR}/Refresh.sh" & "${SCRIPTSDIR}/Refresh.sh" &
} }
@ -46,12 +46,12 @@ main() {
fi fi
case $choice in case $choice in
"no panel") "no panel")
pgrep -x "waybar" && pkill waybar || true pgrep -x "waybar" && pkill waybar || true
;; ;;
*) *)
apply_config "$choice" apply_config "$choice"
;; ;;
esac esac
} }

4
config/hypr/scripts/WaybarStyles.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Script for waybar styles # Script for waybar styles
set -euo pipefail set -euo pipefail
@ -33,7 +33,7 @@ apply_style() {
restart_waybar_if_needed() { restart_waybar_if_needed() {
if pgrep -x "waybar" >/dev/null; then if pgrep -x "waybar" >/dev/null; then
pkill waybar pkill waybar
sleep 0.1 # Delay for Waybar to completely terminate sleep 0.1 # Delay for Waybar to completely terminate
fi fi
"${SCRIPTSDIR}/Refresh.sh" & "${SCRIPTSDIR}/Refresh.sh" &
} }

4
config/hypr/scripts/Wlogout.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# wlogout (Power, Screen Lock, Suspend, etc) # wlogout (Power, Screen Lock, Suspend, etc)
@ -14,7 +14,7 @@ A_720=50
B_720=50 B_720=50
# Check if wlogout is already running # Check if wlogout is already running
if pgrep -x "wlogout" > /dev/null; then if pgrep -x "wlogout" >/dev/null; then
pkill -x "wlogout" pkill -x "wlogout"
exit 0 exit 0
fi fi

Loading…
Cancel
Save