aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/blind.sh12
-rwxr-xr-xbin/record.sh16
-rwxr-xr-xbin/scshot.sh21
-rwxr-xr-xbin/xray.sh9
4 files changed, 58 insertions, 0 deletions
diff --git a/bin/blind.sh b/bin/blind.sh
new file mode 100755
index 0000000..431967c
--- /dev/null
+++ b/bin/blind.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env dash
+
+now=$(TZ=Iran date +%H)
+night=21
+morning=5
+
+if [ "$now" -ge "$night" ] || [ "$now" -le "$morning" ]
+then
+ brightnessctl -q set 200
+else
+ brightnessctl -q set 900
+fi
diff --git a/bin/record.sh b/bin/record.sh
new file mode 100755
index 0000000..be85a2f
--- /dev/null
+++ b/bin/record.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env dash
+
+if [ $# -ne 1 ]; then
+ echo "bad usage"
+ exit
+fi
+
+if [ -n "$(pgrep ffmpeg)" ]; then
+ echo "Already recording"
+ exit
+fi
+
+dunstify "Recording Sarted"
+ffmpeg -v warning -f x11grab -probesize 10M -framerate 25 -i $DISPLAY -crf 30 $1.mkv
+
+dunstify "Recording Stopped"
diff --git a/bin/scshot.sh b/bin/scshot.sh
new file mode 100755
index 0000000..e789c6e
--- /dev/null
+++ b/bin/scshot.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env dash
+
+sspath="$HOME/media"
+ssname="$(date +"%F_%I%M").png"
+
+cd $sspath
+
+if [ "$1" = "a" ]; then
+ scrot $ssname
+else
+ scrot -s $ssname
+fi
+if [ $? -ne 0 ]; then
+ dunstify -t 2000 "Screenshot aborted"
+ exit 0
+fi
+
+xclip -selection clipboard -t image/png $ssname
+
+sleep 1
+dunstify "Screenshot taked" "$sspath\n$ssname"
diff --git a/bin/xray.sh b/bin/xray.sh
new file mode 100755
index 0000000..faf4c0b
--- /dev/null
+++ b/bin/xray.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env dash
+
+if [ -n "$(pgrep xray)" ]; then
+ pkill xray
+ notify-send "Proxy disabled"
+else
+ xray -c $HOME/.config/xray/config.json &
+ notify-send "Proxy enabled"
+fi