From df14b09adfb95fcd600fde95219d3818cbe3d9ca Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Wed, 15 Jan 2025 10:04:50 +0900 Subject: updated Quick Edit.sh --- config/hypr/UserScripts/QuickEdit.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh index 29ce3506..48d5f49a 100755 --- a/config/hypr/UserScripts/QuickEdit.sh +++ b/config/hypr/UserScripts/QuickEdit.sh @@ -13,17 +13,17 @@ UserConfigs="$HOME/.config/hypr/UserConfigs" # Function to display the menu options menu() { cat < Date: Thu, 16 Jan 2025 10:53:08 +0900 Subject: updated some scripts for better notification visibility. Swaync notification width reduce to look better --- config/hypr/UserScripts/RofiBeats.sh | 4 ++-- config/hypr/UserScripts/WallpaperEffects.sh | 6 +++--- config/hypr/UserScripts/ZshChangeTheme.sh | 9 ++++++++- config/hypr/scripts/AirplaneMode.sh | 4 ++-- config/hypr/scripts/Brightness.sh | 2 +- config/hypr/scripts/BrightnessKbd.sh | 2 +- config/hypr/scripts/ChangeBlur.sh | 4 ++-- config/hypr/scripts/ChangeLayout.sh | 4 ++-- config/hypr/scripts/DarkLight.sh | 4 ++-- config/hypr/scripts/GameMode.sh | 4 ++-- config/hypr/scripts/MediaCtrl.sh | 6 +++--- config/hypr/scripts/ScreenShot.sh | 16 ++++++++-------- config/hypr/scripts/SwitchKeyboardLayout.sh | 4 ++-- config/hypr/scripts/TouchPad.sh | 4 ++-- config/hypr/scripts/Volume.sh | 14 +++++++------- config/swaync/config.json | 2 +- 16 files changed, 48 insertions(+), 41 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 51b869f1..54064752 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -39,7 +39,7 @@ populate_local_music() { # Function for displaying notifications notification() { - notify-send -u normal -i "$iDIR/music.png" "$(printf "\n Playing:\n $@")" + notify-send -u normal -i "$iDIR/music.png" " Now Playing:" " $@" } # Main function for playing local music @@ -92,7 +92,7 @@ play_online_music() { } # Check if an online music process is running and send a notification, otherwise run the main function -pkill mpv && notify-send -u low -i "$iDIR/music.png" "$(printf "\n Music stopped")" || { +pkill mpv && notify-send -u low -i "$iDIR/music.png" " Music stopped" || { # Check if rofi is already running if pidof rofi > /dev/null; then diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index b98b572b..08eaf924 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -49,7 +49,7 @@ no-effects() { sleep 2 "$SCRIPTSDIR/Refresh.sh" - notify-send -u low -i "$iDIR/bell.png" "$(printf "\n No wallpaper effects")" + notify-send -u low -i "$iDIR/bell.png" " No wallpaper effects" # copying wallpaper for rofi menu cp "$current_wallpaper" "$wallpaper_output" } @@ -71,7 +71,7 @@ main() { no-effects elif [[ "${effects[$choice]+exists}" ]]; then # Apply selected effect - notify-send -u normal -i "$iDIR/bell.png" "$(printf "\n Applying\n $choice effects")" + notify-send -u normal -i "$iDIR/bell.png" " Applying:" " $choice effects" eval "${effects[$choice]}" # Wait for effects to be applied sleep 1 @@ -85,7 +85,7 @@ main() { sleep 0.5 # Refresh rofi, waybar, wallust palettes "${SCRIPTSDIR}/Refresh.sh" - notify-send -u low -i "$iDIR/bell.png" "$(printf "\n $choice effects\n applied")" + notify-send -u low -i "$iDIR/bell.png" " $choice effects" " applied" else echo "Effect '$choice' not recognized." fi diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh index 662a36bb..7fe7eb39 100755 --- a/config/hypr/UserScripts/ZshChangeTheme.sh +++ b/config/hypr/UserScripts/ZshChangeTheme.sh @@ -8,6 +8,9 @@ themes_dir="$HOME/.oh-my-zsh/themes" file_extension=".zsh-theme" +# Directory for swaync +iDIR="$HOME/.config/swaync/images" + themes_array=($(find "$themes_dir" -type f -name "*$file_extension" -exec basename {} \; | sed -e "s/$file_extension//")) # Add "Random" option to the beginning of the array @@ -26,6 +29,7 @@ main() { # if nothing selected, script won't change anything if [ -z "$choice" ]; then + notify-send -u low -i "$iDIR/bell.png" " No theme selected." " No changes made!" exit 0 fi @@ -36,15 +40,18 @@ main() { # Pick a random theme from the original themes_array (excluding "Random") random_theme=${themes_array[$((RANDOM % (${#themes_array[@]} - 1) + 1))]} theme_to_set="$random_theme" + notify-send -i "$iDIR/bell.png" " Random theme selected: $random_theme" else # Set theme to the selected choice theme_to_set="$choice" + notify-send -i "$iDIR/bell.png" " Theme selected: $choice" fi if [ -f "$zsh_path" ]; then sed -i "s/^$var_name=.*/$var_name=\"$theme_to_set\"/" "$zsh_path" + notify-send -i "$iDIR/bell.png" " OMZ Theme updated" " restart your terminal" else - echo "File not found" + notify-send " Error: .zshrc file not found!" fi } 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 dbbb9244..0ad5e0dc 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -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 @@ -246,7 +246,7 @@ ${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/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 diff --git a/config/swaync/config.json b/config/swaync/config.json index f6077251..2ec0f771 100755 --- a/config/swaync/config.json +++ b/config/swaync/config.json @@ -15,7 +15,7 @@ "notification-icon-size": 24, "notification-body-image-height": 100, "notification-body-image-width": 100, - "notification-window-width": 450, + "notification-window-width": 300, "timeout": 6, "timeout-low": 3, "timeout-critical": 0, -- cgit v1.2.3