diff options
-rwxr-xr-x | bin/.bin/bat | 34 | ||||
-rwxr-xr-x | bin/.bin/bat_check | 14 | ||||
-rwxr-xr-x | bin/.bin/disp | 7 | ||||
-rwxr-xr-x | bin/.bin/record | 30 | ||||
-rwxr-xr-x | bspwm/.config/bspwm/bspwmrc | 10 | ||||
-rwxr-xr-x | polybar/.config/polybar/launch (renamed from polybar/.config/polybar/launch.sh) | 0 | ||||
-rwxr-xr-x | x/.xinitrc | 4 |
7 files changed, 62 insertions, 37 deletions
diff --git a/bin/.bin/bat b/bin/.bin/bat index 473c7e2..38f4272 100755 --- a/bin/.bin/bat +++ b/bin/.bin/bat | |||
@@ -1,12 +1,34 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/sh |
2 | while true | 2 | |
3 | do | 3 | pane() { |
4 | battery_level=$(cat /sys/class/power_supply/BAT0/capacity) | 4 | battery_level=$(cat /sys/class/power_supply/BAT*/capacity) |
5 | state=$(cat /sys/class/power_supply/BAT0/status) | 5 | state=$(cat /sys/class/power_supply/BAT0/status) |
6 | if [ $state == "Charging" ]; then | 6 | if [ $state == "Charging" ]; then |
7 | echo -e +$battery_level% | 7 | echo -e +$battery_level% |
8 | else | 8 | else |
9 | echo -e $battery_level% | 9 | echo -e $battery_level% |
10 | fi | 10 | fi |
11 | sleep 3 | 11 | } |
12 | done | 12 | |
13 | notifs() { | ||
14 | while true | ||
15 | do | ||
16 | battery_level=$(cat /sys/class/power_supply/BAT*/capacity) | ||
17 | state=$(cat /sys/class/power_supply/BAT*/status) | ||
18 | if [ $battery_level -ge 90 ] && [ $state == "Charging" ]; then | ||
19 | notify-send 'Pull the plug!' $battery_level% | ||
20 | elif [ $battery_level -le 30 -a $battery_level -ge 20 ] && [ $state == "Discharging" ]; then | ||
21 | notify-send 'Plug me!' $battery_level% | ||
22 | elif [ $battery_level -le 20 ] && [ $state == "Discharging" ]; then | ||
23 | notify-send -u critical 'Plug me NOW!' $battery_level% | ||
24 | fi | ||
25 | sleep 300 | ||
26 | done | ||
27 | } | ||
28 | |||
29 | case "$1" in | ||
30 | n) | ||
31 | notifs;; | ||
32 | *) | ||
33 | pane;; | ||
34 | esac | ||
diff --git a/bin/.bin/bat_check b/bin/.bin/bat_check deleted file mode 100755 index 547b976..0000000 --- a/bin/.bin/bat_check +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | while true | ||
3 | do | ||
4 | battery_level=$(cat /sys/class/power_supply/BAT0/capacity) | ||
5 | state=$(cat /sys/class/power_supply/BAT0/status) | ||
6 | if [ $battery_level -ge 90 ] && [ $state == "Charging" ]; then | ||
7 | notify-send 'Pull the plug!' $battery_level% | ||
8 | elif [ $battery_level -le 30 -a $battery_level -ge 20 ] && [ $state == "Discharging" ]; then | ||
9 | notify-send 'Plug me!' $battery_level% | ||
10 | elif [ $battery_level -le 20 ] && [ $state == "Discharging" ]; then | ||
11 | notify-send -u critical 'Plug me NOW!' $battery_level% | ||
12 | fi | ||
13 | sleep 300 # 300 seconds or 5 minutes | ||
14 | done | ||
diff --git a/bin/.bin/disp b/bin/.bin/disp index 89045b2..43d6987 100755 --- a/bin/.bin/disp +++ b/bin/.bin/disp | |||
@@ -1,7 +1,10 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | |||
2 | status=$(cat /sys/class/drm/card0/*HDMI*/status) | 3 | status=$(cat /sys/class/drm/card0/*HDMI*/status) |
3 | if [ $status == "connected" ]; then | 4 | if [ $status == "connected" ]; then |
4 | xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x1080 --rotate normal --output HDMI-1 --mode 1366x768 --pos 0x0 --scale 1.4x1.4 --rotate normal --output DisplayPort-0 --off | 5 | xrandr --output eDP-1 --mode 1920x1080 --pos 0x1076 --rotate normal --output HDMI-1 --primary --mode 1366x768 --scale 1.4x1.4 --pos 0x0 --rotate normal --output DP-1 --off |
6 | bspc wm -r | ||
5 | else | 7 | else |
6 | xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --off | 8 | xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --off --output DisplayPort-0 --off |
9 | bspc wm -r | ||
7 | fi | 10 | fi |
diff --git a/bin/.bin/record b/bin/.bin/record index 09ba7d1..86d9b1a 100755 --- a/bin/.bin/record +++ b/bin/.bin/record | |||
@@ -1,10 +1,24 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | ffmpeg -f x11grab \ | 3 | usage() { |
4 | -s 1920x1080 \ | 4 | echo " |
5 | -an -i :0.0 \ | 5 | screen recording using ffmpeg |
6 | -c:v libvpx \ | 6 | usage: ${0##*/} [ -w/a ] |
7 | -b:v 5M \ | 7 | |
8 | -crf 10 \ | 8 | option: |
9 | -quality realtime \ | 9 | -w without audio |
10 | -y ~/record.mkv | 10 | -a with audio |
11 | " | ||
12 | exit 1 | ||
13 | } | ||
14 | |||
15 | case $1 in | ||
16 | -w) | ||
17 | ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 ~/screens/vids/record_$(date +%d-%b-%y-%I:%M%p).mkv | ||
18 | ;; | ||
19 | -a) | ||
20 | ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 -f pulse -ac 2 -i default ~/screens/vids/record_$(date +%d-%b-%y-%I:%M%p).mkv | ||
21 | ;; | ||
22 | *) usage | ||
23 | esac | ||
24 | |||
diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index cfc46bd..7c0df1b 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc | |||
@@ -20,16 +20,12 @@ bspc rule -a Steam desktop='^6' | |||
20 | bspc rule -a "VirtualBox Manager" desktop='^6' | 20 | bspc rule -a "VirtualBox Manager" desktop='^6' |
21 | 21 | ||
22 | # autostart | 22 | # autostart |
23 | xrdb -merge ~/.Xresources & | ||
24 | xsetroot -cursor_name left_ptr & | ||
25 | sxhkd & | 23 | sxhkd & |
26 | xss-lock -- slock & | 24 | xss-lock -- slock & |
27 | xset b off & | ||
28 | xset s 300 & | ||
29 | ~/.fehbg & | ||
30 | urxvtd & | 25 | urxvtd & |
31 | ~/.bin/bat_check & | ||
32 | picom --experimental-backends & | 26 | picom --experimental-backends & |
33 | dunst & | 27 | dunst & |
34 | ~/.config/polybar/launch.sh & | ||
35 | /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & | 28 | /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & |
29 | ~/.fehbg & | ||
30 | ~/.config/polybar/launch & | ||
31 | ~/.bin/bat n & | ||
diff --git a/polybar/.config/polybar/launch.sh b/polybar/.config/polybar/launch index c39a374..c39a374 100755 --- a/polybar/.config/polybar/launch.sh +++ b/polybar/.config/polybar/launch | |||
@@ -2,4 +2,8 @@ | |||
2 | setxkbmap -layout us -option caps:ctrl_modifier & | 2 | setxkbmap -layout us -option caps:ctrl_modifier & |
3 | xcape -e 'Caps_Lock=Escape' & | 3 | xcape -e 'Caps_Lock=Escape' & |
4 | xinput --disable "ETPS/2 Elantech Touchpad" | 4 | xinput --disable "ETPS/2 Elantech Touchpad" |
5 | xrdb -merge ~/.Xresources & | ||
6 | xsetroot -cursor_name left_ptr & | ||
7 | xset b off & | ||
8 | xset s 300 & | ||
5 | exec dbus-run-session bspwm | 9 | exec dbus-run-session bspwm |