aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/hyprshot
blob: f8398a10d6e9727a14c8355d2a1accb1d950d6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

part() {
  geometry="$(slurp)"
  sleep "0.5"
  grim -g "${geometry}" - | wl-copy
}

full() {
  grim - | wl-copy
}

rec() {
  killall -SIGINT gpu-screen-recorder
  homeuser='/home/awy'
  availableDisplay=$(hyprctl monitors | grep Monitor | cut -d' ' -f2)
  filename=$(date +"%Y-%m-%d %H:%M:%S")
  choice="$(printf "$availableDisplay\nExit\n" | rofi -dmenu -l "5")"
  [ "${choice}" != "Exit" ] || [ -z "${choice}" ] &&
  gpu-screen-recorder -w $choice -f 60 -a default_output -a default_input -o "$homeuser/$filename.mp4" 
  
}

case $1 in
  1) part ;;
  2) full ;;
  3) rec ;;
esac