hyprland scripts
This commit is contained in:
18
.config/hypr/scripts/screenshot/screenshot_area.sh
Executable file
18
.config/hypr/scripts/screenshot/screenshot_area.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
###
|
||||
### ~/.config/hypr/scripts/screenshot/screenshot_area.sh
|
||||
###
|
||||
|
||||
time=`date +%Y-%m-%d-%I-%M-%S`
|
||||
geometry=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | "\(.width)x\(.height)"')
|
||||
dir="`xdg-user-dir PICTURES`/Screenshots"
|
||||
file="Screenshot_${time}_${geometry}.png"
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
# Take Screenshot
|
||||
cd "$dir" && grim -g "$(slurp)" "$file" && wl-copy < "$file"
|
||||
# Open Screenshot
|
||||
viewnior ${dir}/"$file"
|
||||
16
.config/hypr/scripts/screenshot/screenshot_area_2.sh
Executable file
16
.config/hypr/scripts/screenshot/screenshot_area_2.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
###
|
||||
### ~/.config/hypr/scripts/screenshot/screenshot_area.sh
|
||||
###
|
||||
|
||||
time=`date +%Y-%m-%d-%I-%M-%S`
|
||||
geometry=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | "\(.width)x\(.height)"')
|
||||
dir="`xdg-user-dir PICTURES`/Screenshots"
|
||||
file="Screenshot_${time}_${geometry}.png"
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
# Take Screenshot
|
||||
cd "$dir" && grim -g "$(slurp)" "$file" && wl-copy < "$file"
|
||||
13
.config/hypr/scripts/screenshot/screenshot_monitor.sh
Executable file
13
.config/hypr/scripts/screenshot/screenshot_monitor.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
time=`date +%Y-%m-%d-%I-%M-%S`
|
||||
geometry=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .current_mode.width, .current_mode.height' | tr '\n' 'x')
|
||||
dir="`xdg-user-dir PICTURES`/Screenshots"
|
||||
file="Screenshot_${time}_${geometry}.png"
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
# Take Screenshot
|
||||
cd "$dir" && sleep 0.5 && grim "$file" && wl-copy < "$file"
|
||||
# Open Screenshot
|
||||
viewnior ${dir}/"$file"
|
||||
15
.config/hypr/scripts/screenshot/screenshot_window.sh
Executable file
15
.config/hypr/scripts/screenshot/screenshot_window.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
time=`date +%Y-%m-%d-%I-%M-%S`
|
||||
geometry=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | "\(.width)x\(.height)"')
|
||||
dir="`xdg-user-dir PICTURES`/Screenshots"
|
||||
file="Screenshot_${time}_${geometry}.png"
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
focused_window=$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||
|
||||
# Take Screenshot
|
||||
cd "$dir" && grim -g "$focused_window" "$file" && wl-copy < "$file"
|
||||
# Open Screenshot
|
||||
viewnior ${dir}/"$file"
|
||||
Reference in New Issue
Block a user