diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-12-27 13:23:34 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-12-27 13:23:34 +0900 |
| commit | 1e2a3b25aa760885ee326433ef0ab176e39c73bc (patch) | |
| tree | f9a14d7eb0dac4e0458083eff4708c9aaebfb4f3 /config/hypr/scripts | |
| parent | 3eb715f78172f2e854fc744841ee74203af28073 (diff) | |
updated for swaync
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/AirplaneMode.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/Brightness.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/BrightnessKbd.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/ChangeBlur.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/ChangeLayout.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/DarkLight.sh | 17 | ||||
| -rwxr-xr-x | config/hypr/scripts/GameMode.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/MediaCtrl.sh | 10 | ||||
| -rwxr-xr-x | config/hypr/scripts/PywalDunst.sh | 24 | ||||
| -rwxr-xr-x | config/hypr/scripts/RefreshNoWaybar.sh | 3 | ||||
| -rwxr-xr-x | config/hypr/scripts/RofiBeats.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/ScreenShot.sh | 12 | ||||
| -rwxr-xr-x | config/hypr/scripts/SwitchKeyboardLayout.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/scripts/TouchPad.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/Volume.sh | 2 |
15 files changed, 36 insertions, 72 deletions
diff --git a/config/hypr/scripts/AirplaneMode.sh b/config/hypr/scripts/AirplaneMode.sh index 6e2eecff..e0337dc7 100755 --- a/config/hypr/scripts/AirplaneMode.sh +++ b/config/hypr/scripts/AirplaneMode.sh @@ -1,12 +1,12 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')" if [ "$wifi" == "enabled" ]; then rfkill block all & - notify-send -e -u normal -i "$dunst_notif" -t 1000 'airplane mode: active' + notify-send -u low -i "$notif" 'airplane mode: active' else rfkill unblock all & - notify-send -e -u normal -i "$dunst_notif" -t 1000 'airplane mode: inactive' + notify-send -u low -i "$notif" 'airplane mode: inactive' fi diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 1c68ec5e..14c03da5 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -1,6 +1,6 @@ #!/bin/bash -iDIR="$HOME/.config/dunst/icons" +iDIR="$HOME/.config/swaync/icons" notification_timeout=1000 # Get brightness diff --git a/config/hypr/scripts/BrightnessKbd.sh b/config/hypr/scripts/BrightnessKbd.sh index 3ea9e493..3bdcebcb 100755 --- a/config/hypr/scripts/BrightnessKbd.sh +++ b/config/hypr/scripts/BrightnessKbd.sh @@ -1,6 +1,6 @@ #!/bin/bash -iDIR="$HOME/.config/dunst/icons" +iDIR="$HOME/.config/swaync/icons" # Get keyboard brightness get_kbd_backlight() { diff --git a/config/hypr/scripts/ChangeBlur.sh b/config/hypr/scripts/ChangeBlur.sh index 76e5ed80..95789f5c 100755 --- a/config/hypr/scripts/ChangeBlur.sh +++ b/config/hypr/scripts/ChangeBlur.sh @@ -1,15 +1,15 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +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 "$dunst_notif" "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 "$dunst_notif" "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 69ded6c6..93bc2fe9 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -1,6 +1,6 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g') @@ -12,7 +12,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 "$dunst_notif" "Dwindle Layout" + notify-send -e -u low -i "$notif" "Dwindle Layout" ;; "dwindle") hyprctl keyword general:layout master @@ -21,7 +21,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 "$dunst_notif" "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 612540b8..a2b7af70 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -5,9 +5,8 @@ wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers" dark_wallpapers="$wallpaper_base_path/Dark" light_wallpapers="$wallpaper_base_path/Light" hypr_config_path="$HOME/.config/hypr" -dunst_config="$HOME/.config/dunst" SCRIPTSDIR="$HOME/.config/hypr/scripts" -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" dark_rofi_pywal="$HOME/.cache/wal/colors-rofi-dark.rasi" light_rofi_pywal="$HOME/.cache/wal/colors-rofi-light.rasi" @@ -38,7 +37,7 @@ update_theme_mode() { # Function to notify user notify_user() { - dunstify -u low -i "$dunst_notif" "Switching to $1 mode" + notify-send -u low -i "$notif" "Switching to $1 mode" } # Function to set Waybar style @@ -61,14 +60,6 @@ set_waybar_style() { set_waybar_style "$next_mode" notify_user "$next_mode" -# Change background for dunst -if [ "$next_mode" = "Dark" ]; then - sed -i '/background = /s/.*/ background = "#00000095"/' "${dunst_config}/dunstrc" - sed -i '/foreground = /s/.*/ foreground = "#fafafa"/' "${dunst_config}/dunstrc" -else - sed -i '/background = /s/.*/ background = "#ffffff99"/' "${dunst_config}/dunstrc" - sed -i '/foreground = /s/.*/ foreground = "#00000095"/' "${dunst_config}/dunstrc" -fi # Set Dynamic Wallpaper for Dark or Light Mode if [ "$next_mode" = "Dark" ]; then @@ -186,8 +177,8 @@ sleep 1 ${SCRIPTSDIR}/Refresh.sh # Display notifications for theme and icon changes -dunstify -u normal -i "$dunst_notif" "Themes are set to $selected_theme" -dunstify -u normal -i "$dunst_notif" "Icon themes set to $selected_icon" +notify-send -u normal -i "$notif" "Themes are set to $selected_theme" +notify-send -u normal -i "$notif" "Icon themes set to $selected_icon" exit 0 diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh index 678d282e..d53ec7d3 100755 --- a/config/hypr/scripts/GameMode.sh +++ b/config/hypr/scripts/GameMode.sh @@ -1,6 +1,6 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" SCRIPTSDIR="$HOME/.config/hypr/scripts" @@ -15,7 +15,7 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then keyword general:border_size 1;\ keyword decoration:rounding 0" swww kill - notify-send -e -u low -i "$dunst_notif" "gamemode enabled. All animations off" + notify-send -e -u low -i "$notif" "gamemode enabled. All animations off" exit else swww init && swww img "$HOME/.config/rofi/.current_wallpaper" @@ -23,7 +23,7 @@ else ${SCRIPTSDIR}/PywalSwww.sh sleep 0.5 ${SCRIPTSDIR}/Refresh.sh - notify-send -e -u normal -i "$dunst_notif" "gamemode disabled. All animations normal" + notify-send -e -u normal -i "$notif" "gamemode disabled. All animations normal" exit fi hyprctl reload diff --git a/config/hypr/scripts/MediaCtrl.sh b/config/hypr/scripts/MediaCtrl.sh index f9611523..9d970443 100755 --- a/config/hypr/scripts/MediaCtrl.sh +++ b/config/hypr/scripts/MediaCtrl.sh @@ -1,6 +1,6 @@ #!/bin/bash -music_icon="$HOME/.config/dunst/icons/music.png" +music_icon="$HOME/.config/swaync/icons/music.png" # Play the next track play_next() { @@ -23,18 +23,18 @@ toggle_play_pause() { # Stop playback stop_playback() { playerctl stop - dunstify -r 123 -i "$music_icon" "Playback Stopped" + notify-send -e -u low -i "$music_icon" "Playback Stopped" } -# Display Dunst notification with song information +# Display notification with song information show_music_notification() { status=$(playerctl status) if [[ "$status" == "Playing" ]]; then song_title=$(playerctl metadata title) song_artist=$(playerctl metadata artist) - dunstify -r 123 -i "$music_icon" "Now Playing:" "$song_title\nby $song_artist" + notify-send -e -u low -i "$music_icon" "Now Playing:" "$song_title\nby $song_artist" elif [[ "$status" == "Paused" ]]; then - dunstify -r 123 -i "$music_icon" "Playback Paused" + notify-send -e -u low -i "$music_icon" "Playback Paused" fi } diff --git a/config/hypr/scripts/PywalDunst.sh b/config/hypr/scripts/PywalDunst.sh deleted file mode 100755 index 1c9398f2..00000000 --- a/config/hypr/scripts/PywalDunst.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# -lf/nf/cf color -# Defines the foreground color for low, normal and critical notifications respectively. -# -# -lb/nb/cb color -# Defines the background color for low, normal and critical notifications respectively. -# -# -lfr/nfr/cfr color -# Defines the frame color for low, normal and critical notifications respectively. - -[ -f "$HOME/.cache/wal/colors.sh" ] && . "$HOME/.cache/wal/colors.sh" - -pkill dunst - -DUNST_FILE=~/.config/dunst/dunstrc - -# update dunst based on pywal colors. -#sed -i '/background = /s/.*/ background = "$color0"/' $DUNST_FILE -#sed -i '/foreground = /s/.*/ foreground = "'$color7'"/' $DUNST_FILE -sed -i '/frame_color = /s/.*/ frame_color = "'$color2'"/' $DUNST_FILE - -sleep 0.3 -dunst -config ~/.config/dunst/dunstrc > /dev/null 2>&1 &
\ No newline at end of file diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index 0b74f011..dc99b623 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -17,9 +17,6 @@ done # Pywal refresh ${SCRIPTSDIR}/PywalSwww.sh & -sleep 0.5 -# Relaunch dunst with pywal-borders -#${SCRIPTSDIR}/PywalDunst.sh & # Relaunching rainbow borders sleep 1 diff --git a/config/hypr/scripts/RofiBeats.sh b/config/hypr/scripts/RofiBeats.sh index c8e8e43e..405451f5 100755 --- a/config/hypr/scripts/RofiBeats.sh +++ b/config/hypr/scripts/RofiBeats.sh @@ -1,7 +1,7 @@ #!/bin/bash # Directory for icons -iDIR="$HOME/.config/dunst/icons" +iDIR="$HOME/.config/swaync/icons" # Note: You can add more options below with the following format: # ["TITLE"]="link" diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 44ba2bd6..1d5eeacf 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -1,7 +1,7 @@ #!/bin/bash -iDIR="$HOME/.config/dunst/icons" -notify_cmd_shot="dunstify -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" +iDIR="$HOME/.config/swaync/icons" +notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" time=$(date "+%d-%b_%H-%M-%S") dir="$(xdg-user-dir)/Pictures/Screenshots" @@ -15,16 +15,16 @@ active_window_path="${dir}/${active_window_file}" notify_view() { if [[ "$1" == "active" ]]; then if [[ -e "${active_window_path}" ]]; then - ${notify_cmd_shot} "Screenshot of '${active_window_class}' is saved." + ${notify_cmd_shot} "Screenshot of '${active_window_class}' Saved." else - ${notify_cmd_shot} "Screenshot of '${active_window_class}' is deleted or not available." + ${notify_cmd_shot} "Screenshot of '${active_window_class}' not Saved" fi else local check_file="$dir/$file" if [[ -e "$check_file" ]]; then ${notify_cmd_shot} "Screenshot Saved." else - ${notify_cmd_shot} "Screenshot Deleted." + ${notify_cmd_shot} "Screenshot NOT Saved." fi fi } @@ -34,7 +34,7 @@ notify_view() { # countdown countdown() { for sec in $(seq $1 -1 1); do - dunstify -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 done } diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh index 9d1ee844..47469181 100755 --- a/config/hypr/scripts/SwitchKeyboardLayout.sh +++ b/config/hypr/scripts/SwitchKeyboardLayout.sh @@ -2,7 +2,7 @@ layout_f="$HOME/.cache/kb_layout" settings_file="$HOME/.config/hypr/configs/Settings.conf" -dunst_notif="$HOME/.config/dunst/images/bell.png" +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 if [ ! -f "$layout_f" ]; then @@ -40,4 +40,4 @@ hyprctl keyword input:kb_layout "$new_layout" echo "$new_layout" > "$layout_f" # Notification for the new keyboard layout -dunstify -u low -i "$dunst_notif" "Keyboard layout set to $new_layout"
\ No newline at end of file +notify-send -u low -i "$notif" "Keyboard layout set to $new_layout"
\ No newline at end of file diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh index 8f633ee0..7b9a1806 100755 --- a/config/hypr/scripts/TouchPad.sh +++ b/config/hypr/scripts/TouchPad.sh @@ -1,6 +1,6 @@ #!/bin/bash -dunst_notif="$HOME/.config/dunst/images/bell.png" +notif="$HOME/.config/swaync/images/bell.png" # NOTE: find the right device using hyprctl devices HYPRLAND_DEVICE="asue1209:00-04f3:319f-touchpad" @@ -14,7 +14,7 @@ export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" enable_touchpad() { printf "true" > "$STATUS_FILE" - dunstify -u low -i "$dunst_notif" "Enabling Touchpad" + notify-send -u low -i "$notif" "Enabling Touchpad" hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" true } @@ -22,7 +22,7 @@ enable_touchpad() { disable_touchpad() { printf "false" > "$STATUS_FILE" - dunstify -u low -i "$dunst_notif" "Disabling Touchpad" + notify-send -u low -i "$notif" "Disabling Touchpad" hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" false } diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh index 9aaf8a8c..f68491cf 100755 --- a/config/hypr/scripts/Volume.sh +++ b/config/hypr/scripts/Volume.sh @@ -1,6 +1,6 @@ #!/bin/bash -iDIR="$HOME/.config/dunst/icons" +iDIR="$HOME/.config/swaync/icons" # Get Volume get_volume() { |
