diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-12-27 00:37:26 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-12-27 00:37:26 +0900 |
| commit | 0bdc93e101308e6aa43438dcb0de67182a865622 (patch) | |
| tree | 3f575f19ed474a10451f30d2f6ba6e031a1cafaf /config/hypr/scripts | |
| parent | 453d8b3f439d022569ea0b077e7c69039d96746a (diff) | |
updated swaync
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/KeyHints.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/PywalSwaync.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 11 | ||||
| -rwxr-xr-x | config/hypr/scripts/RefreshNoWaybar.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/ScreenShot.sh | 48 |
5 files changed, 46 insertions, 27 deletions
diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 7bb80e18..a9d93d00 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -45,13 +45,15 @@ yad --width=$dynamic_width --height=$dynamic_height \ " Alt V" "Clipboard Manager" "(cliphist)" \ " W" "Choose wallpaper" "(swww)" \ "CTRL ALT W" "Random wallpaper" "(swww)" \ -" CTRL B" "Choose waybar styles" "(waybar styles)" \ " B" "Hide/UnHide Waybar" "waybar" \ +" CTRL B" "Choose waybar styles" "(waybar styles)" \ " ALT B" "Choose waybar layout" "(waybar layout)" \ -" ALT R" "Reload Waybar Dunst Rofi" "" \ +" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \ +" SHIFT N" "Launch Notification Pannel" "SwayNC Control Center" \ " Print" "screenshot" "(grim)" \ " Shift Print" "screenshot region" "(grim + slurp)" \ " Shift S" "screenshot region" "(swappy)" \ +"ALT Print" "Screenshot active window" "active window only" \ "CTRL ALT P" "power-menu" "(wlogout)" \ "CTRL ALT L" "screen lock" "(swaylock)" \ "CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ diff --git a/config/hypr/scripts/PywalSwaync.sh b/config/hypr/scripts/PywalSwaync.sh deleted file mode 100755 index aad1acb8..00000000 --- a/config/hypr/scripts/PywalSwaync.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -pkill swaync - -sleep 0.3 -swaync > /dev/null 2>&1 &
\ No newline at end of file diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index dd773ef2..3838b5e3 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -3,7 +3,7 @@ SCRIPTSDIR=$HOME/.config/hypr/scripts # Kill already running processes -_ps=(waybar rofi) +_ps=(waybar rofi swaync) for _prs in "${_ps[@]}"; do if pidof "${_prs}" >/dev/null; then pkill "${_prs}" @@ -14,12 +14,9 @@ sleep 0.1 # Relaunch waybar waybar & -sleep 0.1 -# Relaunch dunst with pywal-borders -# ${SCRIPTSDIR}/PywalDunst.sh & - -# Relaunch swaync with pywal-borders -${SCRIPTSDIR}/PywalSwaync.sh +# relaunch swaync +sleep 0.3 +swaync > /dev/null 2>&1 & # Relaunching rainbow borders sleep 1 diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index c834a531..0b74f011 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -19,7 +19,7 @@ ${SCRIPTSDIR}/PywalSwww.sh & sleep 0.5 # Relaunch dunst with pywal-borders -${SCRIPTSDIR}/PywalDunst.sh & +#${SCRIPTSDIR}/PywalDunst.sh & # Relaunching rainbow borders sleep 1 diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 06826275..44ba2bd6 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -1,27 +1,40 @@ #!/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" -time=$(date +%Y-%m-%d-%H-%M-%S) +time=$(date "+%d-%b_%H-%M-%S") dir="$(xdg-user-dir)/Pictures/Screenshots" file="Screenshot_${time}_${RANDOM}.png" +active_window_class=$(hyprctl -j activewindow | jq -r '(.class)') +active_window_file="Screenshot_${time}_${active_window_class}.png" +active_window_path="${dir}/${active_window_file}" + # notify and view screenshot -notify_cmd_shot="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png" notify_view() { - ${notify_cmd_shot} "Copied to clipboard." -## viewnior ${dir}/"$file" - if [[ -e "$dir/$file" ]]; then - ${notify_cmd_shot} "Screenshot Saved." - else - ${notify_cmd_shot} "Screenshot Deleted." - fi + if [[ "$1" == "active" ]]; then + if [[ -e "${active_window_path}" ]]; then + ${notify_cmd_shot} "Screenshot of '${active_window_class}' is saved." + else + ${notify_cmd_shot} "Screenshot of '${active_window_class}' is deleted or not available." + fi + else + local check_file="$dir/$file" + if [[ -e "$check_file" ]]; then + ${notify_cmd_shot} "Screenshot Saved." + else + ${notify_cmd_shot} "Screenshot Deleted." + fi + fi } + + # 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 "Taking shot in : $sec" + dunstify -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png "Taking shot in : $sec" sleep 1 done } @@ -59,6 +72,17 @@ shotarea() { notify_view } +shotactive() { + active_window_class=$(hyprctl -j activewindow | jq -r '(.class)') + active_window_file="Screenshot_${time}_${active_window_class}.png" + 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}" + sleep 1 + notify_view "active" +} + + if [[ ! -d "$dir" ]]; then mkdir -p "$dir" fi @@ -73,8 +97,10 @@ elif [[ "$1" == "--win" ]]; then shotwin elif [[ "$1" == "--area" ]]; then shotarea +elif [[ "$1" == "--active" ]]; then + shotactive else - echo -e "Available Options : --now --in5 --in10 --win --area" + echo -e "Available Options : --now --in5 --in10 --win --area --active" fi exit 0 |
