aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-01-16 10:54:47 +0900
committerGitHub <noreply@github.com>2025-01-16 10:54:47 +0900
commitc30b1c5599daa78169486d76c9d3dd2fba3803a8 (patch)
treea50caee93fc0c2f0d8c02f6d0120af71cc24f1ac /config/hypr/scripts
parenta4956da883d5fe2d66d528d2e9a890a2c6d064a8 (diff)
parent47a6c42c77244b4b18f6e074542c15bc43bc4273 (diff)
Merge pull request #526 from JaKooLit/development
Development to main
Diffstat (limited to 'config/hypr/scripts')
-rwxr-xr-xconfig/hypr/scripts/AirplaneMode.sh4
-rwxr-xr-xconfig/hypr/scripts/Brightness.sh2
-rwxr-xr-xconfig/hypr/scripts/BrightnessKbd.sh2
-rwxr-xr-xconfig/hypr/scripts/ChangeBlur.sh4
-rwxr-xr-xconfig/hypr/scripts/ChangeLayout.sh4
-rwxr-xr-xconfig/hypr/scripts/DarkLight.sh16
-rwxr-xr-xconfig/hypr/scripts/GameMode.sh4
-rwxr-xr-xconfig/hypr/scripts/MediaCtrl.sh6
-rwxr-xr-xconfig/hypr/scripts/Refresh.sh22
-rwxr-xr-xconfig/hypr/scripts/ScreenShot.sh16
-rwxr-xr-xconfig/hypr/scripts/SwitchKeyboardLayout.sh4
-rwxr-xr-xconfig/hypr/scripts/TouchPad.sh4
-rwxr-xr-xconfig/hypr/scripts/Volume.sh14
13 files changed, 57 insertions, 45 deletions
diff --git a/config/hypr/scripts/AirplaneMode.sh b/config/hypr/scripts/AirplaneMode.sh
index cd061c76..89546e76 100755
--- a/config/hypr/scripts/AirplaneMode.sh
+++ b/config/hypr/scripts/AirplaneMode.sh
@@ -9,8 +9,8 @@ wifi_blocked=$(rfkill list wifi | grep -o "Soft blocked: yes")
if [ -n "$wifi_blocked" ]; then
rfkill unblock wifi
- notify-send -u low -i "$notif" "$(printf "\n Airplane mode: OFF")"
+ notify-send -u low -i "$notif" " Airplane mode:" " Switched OFF"
else
rfkill block wifi
- notify-send -u low -i "$notif" "$(printf "\n Airplane mode: ON")"
+ notify-send -u low -i "$notif" " Airplane mode:" " Switched ON"
fi
diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh
index 538d7cfd..4578e509 100755
--- a/config/hypr/scripts/Brightness.sh
+++ b/config/hypr/scripts/Brightness.sh
@@ -29,7 +29,7 @@ get_icon() {
# Notify
notify_user() {
- notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "$(printf "\n Brightness : $current%")"
+ notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" " Screen Brightness:" " $current %"
}
# Change brightness
diff --git a/config/hypr/scripts/BrightnessKbd.sh b/config/hypr/scripts/BrightnessKbd.sh
index c34e09c6..67f8b87e 100755
--- a/config/hypr/scripts/BrightnessKbd.sh
+++ b/config/hypr/scripts/BrightnessKbd.sh
@@ -26,7 +26,7 @@ get_icon() {
}
# Notify
notify_user() {
- notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "$(printf "\n 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
diff --git a/config/hypr/scripts/ChangeBlur.sh b/config/hypr/scripts/ChangeBlur.sh
index 4df80fa1..c9d8c25c 100755
--- a/config/hypr/scripts/ChangeBlur.sh
+++ b/config/hypr/scripts/ChangeBlur.sh
@@ -9,9 +9,9 @@ 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" "$(printf "\n Less Blur")"
+ 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" "$(printf "\n Normal Blur")"
+ notify-send -e -u low -i "$notif" " Normal Blur"
fi
diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh
index dbfe092b..b13142cf 100755
--- a/config/hypr/scripts/ChangeLayout.sh
+++ b/config/hypr/scripts/ChangeLayout.sh
@@ -14,7 +14,7 @@ case $LAYOUT in
hyprctl keyword bind SUPER,J,cyclenext
hyprctl keyword bind SUPER,K,cyclenext,prev
hyprctl keyword bind SUPER,O,togglesplit
- notify-send -e -u low -i "$notif" "$(printf "\n Dwindle Layout")"
+ notify-send -e -u low -i "$notif" " Dwindle Layout"
;;
"dwindle")
hyprctl keyword general:layout master
@@ -23,7 +23,7 @@ case $LAYOUT in
hyprctl keyword unbind SUPER,O
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
- notify-send -e -u low -i "$notif" "$(printf "\n Master Layout")"
+ notify-send -e -u low -i "$notif" " Master Layout"
;;
*) ;;
diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh
index 50395493..0ad5e0dc 100755
--- a/config/hypr/scripts/DarkLight.sh
+++ b/config/hypr/scripts/DarkLight.sh
@@ -24,7 +24,7 @@ pallete_light="light16"
pkill swaybg
# Initialize swww if needed
-swww query || swww-daemon
+swww query || swww-daemon --format xrgb
# Set swww options
swww="swww img"
@@ -48,7 +48,7 @@ update_theme_mode() {
# Function to notify user
notify_user() {
- notify-send -u low -i "$notif" "$(printf "\n Switching to $1 mode")"
+ notify-send -u low -i "$notif" " Switching to" " $1 mode"
}
# Use sed to replace the palette setting in the wallust config file
@@ -109,6 +109,7 @@ else
sed -i '/^background /s/^background .*/background #dddddd/' "${kitty_conf}"
sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}"
fi
+
for pid in $(pidof kitty); do
kill -SIGUSR1 "$pid"
done
@@ -231,12 +232,21 @@ update_theme_mode
${SCRIPTSDIR}/WallustSwww.sh &&
+
+# some process to kill
+_ps=(waybar rofi swaync ags swaybg)
+for _prs in "${_ps[@]}"; do
+ if pidof "${_prs}" >/dev/null; then
+ pkill "${_prs}"
+ fi
+done
+
sleep 2
${SCRIPTSDIR}/Refresh.sh
sleep 0.3
# Display notifications for theme and icon changes
-notify-send -u normal -i "$notif" "$(printf "\n Themes switched to \n $next_mode Mode")"
+notify-send -u normal -i "$notif" " Themes switched to:" " $next_mode Mode"
exit 0
diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh
index 8c746506..7bad0909 100755
--- a/config/hypr/scripts/GameMode.sh
+++ b/config/hypr/scripts/GameMode.sh
@@ -19,7 +19,7 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then
hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$"
swww kill
- notify-send -e -u low -i "$notif" "$(printf "\n gamemode enabled\n All animations: OFF")"
+ notify-send -e -u low -i "$notif" " gamemode enabled" " All animations: OFF"
exit
else
swww-daemon --format xrgb && swww img "$HOME/.config/rofi/.current_wallpaper" &
@@ -27,7 +27,7 @@ else
${SCRIPTSDIR}/WallustSwww.sh
sleep 0.5
${SCRIPTSDIR}/Refresh.sh
- notify-send -e -u normal -i "$notif" "$(printf "\n gamemode enabled\n All animations: normal")"
+ notify-send -e -u normal -i "$notif" " gamemode enabled" " All animations: normal"
exit
fi
hyprctl reload
diff --git a/config/hypr/scripts/MediaCtrl.sh b/config/hypr/scripts/MediaCtrl.sh
index e0fec253..f519340f 100755
--- a/config/hypr/scripts/MediaCtrl.sh
+++ b/config/hypr/scripts/MediaCtrl.sh
@@ -25,7 +25,7 @@ toggle_play_pause() {
# Stop playback
stop_playback() {
playerctl stop
- notify-send -e -u low -i "$music_icon" "$(printf "\n Playback Stopped")"
+ notify-send -e -u low -i "$music_icon" " Playback Stopped"
}
# Display notification with song information
@@ -34,9 +34,9 @@ show_music_notification() {
if [[ "$status" == "Playing" ]]; then
song_title=$(playerctl metadata title)
song_artist=$(playerctl metadata artist)
- notify-send -e -u low -i "$music_icon" "$(printf "\n Now Playing: $song_title\n by $song_artist")"
+ notify-send -e -u low -i "$music_icon" " Now Playing:" " $song_title by $song_artist"
elif [[ "$status" == "Paused" ]]; then
- notify-send -e -u low -i "$music_icon" "$(printf "\n Playback Paused")"
+ notify-send -e -u low -i "$music_icon" " Playback Paused"
fi
}
diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh
index 78f76702..77ba1496 100755
--- a/config/hypr/scripts/Refresh.sh
+++ b/config/hypr/scripts/Refresh.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
-# Scripts for refreshing ags waybar, rofi, swaync, wallust
+# Scripts for refreshing ags, waybar, rofi, swaync, wallust
SCRIPTSDIR=$HOME/.config/hypr/scripts
UserScripts=$HOME/.config/hypr/UserScripts
@@ -27,21 +27,23 @@ killall -SIGUSR2 waybar # added since wallust sometimes not applying
# quit ags
ags -q
-# relaunch swaync
-sleep 0.5
-swaync > /dev/null 2>&1 &
-
# relaunch ags
ags &
-# Kill waybar (yet again) # added since wallust sometimes not applying
-if pidof waybar >/dev/null; then
- pkill waybar
-fi
+# Kill waybar & swaync (yet again) # added since wallust sometimes not applying
+_ps2=(waybar swaync)
+for _prs2 in "${_ps2[@]}"; do
+ if pidof "${_prs2}" >/dev/null; then
+ killall "${_prs2}"
+ fi
+done
+# relaunch swaync
+sleep 0.5
+swaync > /dev/null 2>&1 &
-sleep 1
#Restart waybar
+sleep 1
waybar &
# Relaunching rainbow borders if the script exists
diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh
index 0c6e8612..3fdd15b8 100755
--- a/config/hypr/scripts/ScreenShot.sh
+++ b/config/hypr/scripts/ScreenShot.sh
@@ -15,15 +15,15 @@ active_window_path="${dir}/${active_window_file}"
notify_cmd_base="notify-send -t 10000 -A action1=Open -A action2=Delete -h string:x-canonical-private-synchronous:shot-notify"
#notify_swappy="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
-notify_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png"
-notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png"
+notify_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png "
+notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png "
# notify and view screenshot
notify_view() {
if [[ "$1" == "active" ]]; then
if [[ -e "${active_window_path}" ]]; then
"${sDIR}/Sounds.sh" --screenshot
- resp=$(timeout 5 ${notify_cmd_shot_win} "$(printf "\n Screenshot of ${active_window_class}\n Saved.")")
+ resp=$(timeout 5 ${notify_cmd_shot_win} " Screenshot of:" " ${active_window_class} Saved.")
case "$resp" in
action1)
xdg-open "${active_window_path}" &
@@ -33,13 +33,13 @@ notify_view() {
;;
esac
else
- ${notify_cmd_shot} "$(printf "\n Screenshot of ${active_window_class}\n NOT Saved.")"
+ ${notify_cmd_shot} " Screenshot of:" " ${active_window_class} NOT Saved."
"${sDIR}/Sounds.sh" --error
fi
elif [[ "$1" == "swappy" ]]; then
"${sDIR}/Sounds.sh" --screenshot
- resp=$(${notify_cmd_shot} "$(printf "\n Screenshot Captured\n by Swappy")")
+ resp=$(${notify_cmd_shot} " Screenshot:" " Captured by Swappy")
case "$resp" in
action1)
swappy -f - <"$tmpfile"
@@ -53,7 +53,7 @@ notify_view() {
local check_file="${dir}/${file}"
if [[ -e "$check_file" ]]; then
"${sDIR}/Sounds.sh" --screenshot
- resp=$(timeout 5 ${notify_cmd_shot} "$(printf "\n Screenshot Saved")")
+ resp=$(timeout 5 ${notify_cmd_shot} " Screenshot Saved")
case "$resp" in
action1)
xdg-open "${check_file}" &
@@ -63,7 +63,7 @@ notify_view() {
;;
esac
else
- ${notify_cmd_shot} "$(printf "\n Screenshot NOT Saved")"
+ ${notify_cmd_shot} " Screenshot NOT Saved"
"${sDIR}/Sounds.sh" --error
fi
fi
@@ -74,7 +74,7 @@ notify_view() {
# countdown
countdown() {
for sec in $(seq $1 -1 1); do
- notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "$(printf "\n Taking shot in: $sec") secs"
+ notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png " Taking shot" " in: $sec secs"
sleep 1
done
}
diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh
index 6974e386..95e6edc8 100755
--- a/config/hypr/scripts/SwitchKeyboardLayout.sh
+++ b/config/hypr/scripts/SwitchKeyboardLayout.sh
@@ -93,11 +93,11 @@ change_layout() {
# Execute layout change and notify
if ! change_layout; then
- notify-send -u low -t 2000 'kb_layout' "$(printf '\n Error: Layout change failed')"
+ notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed"
echo "Layout change failed." >&2
exit 1
else
- notify-send -u low -i "$notif_icon" "$(printf "\n New kb_layout: $new_layout")"
+ notify-send -u low -i "$notif_icon" " New kb_layout: $new_layout"
echo "Layout change notification sent."
fi
diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh
index 0baee6f6..22dd241b 100755
--- a/config/hypr/scripts/TouchPad.sh
+++ b/config/hypr/scripts/TouchPad.sh
@@ -11,13 +11,13 @@ export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
enable_touchpad() {
printf "true" >"$STATUS_FILE"
- notify-send -u low -i $notif "$(printf '\nEnabling touchpad')"
+ notify-send -u low -i $notif " Enabling touchpad"
hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
}
disable_touchpad() {
printf "false" >"$STATUS_FILE"
- notify-send -u low -i $notif "$(printf '\nDisabling touchpad')"
+ notify-send -u low -i $notif " Disabling touchpad"
hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
}
diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh
index f254dec3..ac1367b7 100755
--- a/config/hypr/scripts/Volume.sh
+++ b/config/hypr/scripts/Volume.sh
@@ -32,9 +32,9 @@ get_icon() {
# Notify
notify_user() {
if [[ "$(get_volume)" == "Muted" ]]; then
- notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "$(printf '\n Volume:\n Muted')"
+ notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume:" " Muted"
else
- notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" "$(printf "\n Volume: $(get_volume)") %" &&
+ notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume:" " $(get_volume) %" &&
"$sDIR/Sounds.sh" --volume
fi
}
@@ -60,18 +60,18 @@ dec_volume() {
# Toggle Mute
toggle_mute() {
if [ "$(pamixer --get-mute)" == "false" ]; then
- pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" "$(printf '\n Mute')"
+ pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" " Muted"
elif [ "$(pamixer --get-mute)" == "true" ]; then
- pamixer -u && notify-send -e -u low -i "$(get_icon)" "$(printf '\n Volume:\n Switched ON')"
+ pamixer -u && notify-send -e -u low -i "$(get_icon)" " Volume:" " Switched ON"
fi
}
# Toggle Mic
toggle_mic() {
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
- pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" "$(printf '\n Microphone:\n 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
- pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" "$(printf '\n Microphone:\n Switched ON')"
+ pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" " Microphone:" " Switched ON"
fi
}
# Get Mic Icon
@@ -98,7 +98,7 @@ get_mic_volume() {
notify_mic_user() {
volume=$(get_mic_volume)
icon=$(get_mic_icon)
- notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" "$(printf " \n Mic-Level: $volume") %"
+ notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" " Mic-Level:" " $volume %"
}
# Increase MIC Volume
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage