Initial commit

This commit is contained in:
Arkaprabha Chakraborty
2023-09-29 03:25:39 +05:30
commit 40352a0e4f
5 changed files with 150 additions and 0 deletions

29
backlight Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/sh
# Script: backlight
# License: MIT
# Author: Arkaprabha Chakraborty
# Created: 02-10-23
# Dependencies: acpilight, dunstify
#
# Copyright (C) 2023 Arkaprabha Chakraborty
PROG=xbacklight
NOTIPROG=dunstify
case $1 in
-i)
# Set the bval on (if it was muted)
$PROG -inc 10
;;
-d)
if [ $($PROG -getf | awk '{print substr($1, 1, length($1)-2)}') -le 20 ]; then
$PROG -set 10
else
$PROG -dec 10
fi
;;
esac
bval=$($PROG -getf | awk '{print substr($1, 1, length($1)-2)}') # brightness value
$NOTIPROG -a "brictl" -u low -r "9997" -h int:value:"$bval" -i "bright-$1" "Brightness: ${bval}%" -t 2000

18
screenshot Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/sh
# Script: screenshot
# License: MIT
# Author: Arkaprabha Chakraborty
# Created: 27-09-23
# Dependencies: maim, dunstify
#
# Copyright (C) 2023 Arkaprabha Chakraborty
PROG=maim
NOTIPROG=dunstify
timestamp=$(date +%F-%T)
PROG -u -s "$HOME/Pictures/Screenshots/$timestamp-screenshot.png"
NOTIPROG "Captured" -a "maim" -u "low" -t "2000" -I "$HOME/Pictures/\
Screenshots/$timestamp-screenshot.png"

23
upcord Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/sh
# Script: upcord
# License: MIT
# Author: Arkaprabha Chakraborty
# Created: 26-02-23
# Dependencies: curl, tar
#
# Copyright (C) 2023 Arkaprabha Chakraborty
if [ -d "/opt/Discord" ]; then
sudo rm -rf /opt/Discord
fi
if [ -L "/bin/discord" ]; then
sudo rm -f /bin/discord
fi
curl -Lfo "Discord.tar.gz" "https://discord.com/api/download?platform=linux&format=tar.gz"
tar xzvf Discord.tar.gz
sudo mv Discord /opt
sudo ln -s /opt/Discord/Discord /bin/discord
rm Discord.tar.gz

63
volume Executable file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/sh
# Script: volume
# License: MIT
# Author: Arkaprabha Chakraborty
# Created: 27-9-23
# Dependencies: pipewire-pulseaudio, pamixer, dunstify
#
# Copyright (C) 2023 Arkaprabha Chakraborty
# semicolon separated volume rules for multiple sinks
rules="<sink> <volume>;<sink> <volume>;<sink> <volume>"
max=80 # default max volume
step=5 # volume change step
shopt -s lastpipe # run last pipe-element in the shell process
# set max volume for default sink
echo -e $rules | tr ';' '\n' | while read rule; do
if [ $(pactl get-default-sink) = $(echo $rule | awk '{ print $1 }') ]; then
max=$(echo $rule | awk '{ print $2 }')
fi
done
case $1 in # pattern match option
-i)
pamixer -u # unmute if muted
# set max volume if intended increase step exceeds max volume
if [ $(pamixer --get-volume) -ge $max ]; then
pamixer --allow-boost --set-volume $max
elif [ $(pamixer --get-volume) -le $max ] && [ $(pamixer --get-volume) -ge $((max - step)) ]; then
pamixer --allow-boost --set-volume $max
else
pamixer -i $step --allow-boost # increase volume
fi
volume=$(pamixer --get-volume) # get current volume
# send notification with current volume
dunstify -a "volume" -u low -r "9993" -h int:value:"$volume" -i "volume-$1" "Volume: ${volume}%" -t 2000
;;
-d)
pamixer -u # unmute if muted
pamixer -d $step --allow-boost # decrease volume
if [ $(pamixer --get-volume) -ge $max ]; then
pamixer --allow-boost --set-volume $max
fi
volume=$(pamixer --get-volume) # get current volume
# send notification with current volume
dunstify -a "volume" -u low -r "9993" -h int:value:"$volume" -i "volume-$1" "Volume: ${volume}%" -t 2000
;;
-m)
pamixer -t # toggle mute
if $(pamixer --get-mute); then # send notification with mute status
dunstify -i volume-mute -a "volume" -t 2000 -r 9993 -u low "Muted"
else
dunstify -i volume-mute -a "volume" -t 2000 -r 9993 -u low "Unmuted"
fi
;;
esac

17
wal Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/sh
# Script: wal
# License: MIT
# Author: Arkaprabha Chakraborty
# Created: 28-07-23
# Dependencies: feh
#
# Copyright (C) 2023 Arkaprabha Chakraborty
PROG=feh # program
FLAGS=--bg-fill # program flags
WALL=$1 # original image
REST=$HOME/.wall # duplicate image
cp $WALL $REST # make a copy
$PROG $FLAGS $REST # set background