This commit is contained in:
sawebb19 2022-12-28 16:44:03 -05:00
commit 6e5095f3cf
35 changed files with 453 additions and 0 deletions

8
1b.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
if [ $(brightnessctl -d intel_backlight get) = 1200 ]
then
brightnessctl -d intel_backlight set 1
else
brightnessctl -d intel_backlight set 1200
fi

8
9b.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
if [ $(brightnessctl -d intel_backlight get) -le 1200 ]
then
brightnessctl -d intel_backlight set 10%
else
brightnessctl -d intel_backlight set +10%
fi

8
blt.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
if [[ $(brightnessctl -d dell::kbd_backlight get) -eq 1 ]]
then
brightnessctl -d dell::kbd_backlight set 0
else
brightnessctl -d dell::kbd_backlight set 1
fi

27
dwm/README.md Normal file
View file

@ -0,0 +1,27 @@
Spotify
- Works. Updates every second. No way of checking a change in song as far as I know. Would be better that way, but until then, we should just keep doing it this way
Volume/Output
- Works. No color for unmuted yet though. May also want a muted headphone icon
Brightness
- Works
Battery/Charing
- Works
Disk
- It's fine. Updates after Updates and (un)Installations in Pacman. Would be nice if this could happen after Steam installations and Firefox downloads too.
Internet
- Works
Date
- Works
Time
- Works
Name
- Works
- Add DMenu confirmation of power options

12
dwm/bright.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/brightMenu.sh;;
esac
light="1%"
if [ $(brightnessctl -d intel_backlight get) -ne 1 ]; then
light="$(awk "BEGIN { print $(brightnessctl -d intel_backlight get)/1200}")%"
fi
echo "^c#FED06E^  ${light} "

5
dwm/brightMenu.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cat <<EOF | xmenu -p 1410x20 | sh &
Redshift 2>/dev/null 1>&2 redshiftgui
EOF

3
dwm/cal.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
dunstify "$(cal)"

27
dwm/charge.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/sh
level=$(cat /sys/class/power_supply/BAT0/capacity)
stats=$(cat /sys/class/power_supply/BAT0/status)
dicon=(            )
uicon=(            )
if [ $stats == "Charging" ]; then
icon=${uicon[$(( level / 10 ))]}
else
icon=${dicon[$(( level / 10 ))]}
fi
if [ $level -ge 0 ]; then
color="^c#F75341^"
fi
if [ $level -ge 20 ]; then
color="^c#FED06E^"
fi
if [ $level -ge 50 ]; then
color="^c#98DC37^"
fi
echo "${color}${icon} ${level}%"

6
dwm/date.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/cal.sh;;
esac
echo "^c#2BE4D0^  $(date +%A", "%D)"

7
dwm/disk.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/diskMenu.sh;;
esac
echo "^c#68A8E4^  $(df /dev/nvme0n1p8 | awk '{print $5}' | sed -n 2p)"

6
dwm/diskMenu.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
cat <<EOF | xmenu -p 1495x20 | sh &
Disk Analysis st -e ncdu ~
Pacman Log Viewer plv
EOF

7
dwm/name.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/nameMenu.sh;;
esac
name=$(who | sed 's/ .*//')
echo "^c#ffffff^ $name "

15
dwm/nameMenu.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
cat <<EOF | xmenu -p 1781x20 | sh &
Power Options
Power Off sudo shutdown -h now
Restart sudo shutdown -r now
Utilities
arandr arandr
lxappearance lxappearance
pcmanfm pcmanfm
qv4l2 qv4l2
st st
xev st -e xev
Change Wallpaper /home/swebb/Scripts/wallpaper.sh
EOF

3
dwm/reset.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
kill -10 $(pidof dwmblocks)

23
dwm/spotify.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
#play=$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus' | grep -o '".*"')
#if [ $(pidof spotify | wc -c) -gt 0 ]
#then
# artist="$(sp metadata | sed -n 6p | sed -E 's/artist\|//')"
# title="$(sp metadata | sed -n 9p | sed -E 's/title\|//')"
# album="$(sp metadata | sed -n 4p | sed -E 's/album\|//')"
# meta="${artist} - ${title} [${album}]"
# if [ $play == \"Paused\" ]; then
# icon=" "
# elif [ $play == \"Playing\" ]; then
# icon=" "
# else
# icon=""
# meta=""
# fi
#fi
# <200b> is the 0 width space. The trailing whitespace gets removed and idk how to prevent that, so I add a 0 width space
#echo "^c#1ED750^${icon}${meta} "
echo "$(playerctl --player=spotify metadata --format '{{ status }}: {{ artist }} - {{ title }}') "

10
dwm/time.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/timeMenu.sh;;
esac
if [ $(date +%R) == "00:00" ]; then
kill -10 $(pidof dwmblocks)
fi
echo "^c#BAA67F^  $(date +%R) ^c#bbbbbb^|"

5
dwm/timeMenu.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cat <<EOF | xmenu -p 1781x20 | sh &
Timer st -e termdown
EOF

4
dwm/ublocks.sh Executable file
View file

@ -0,0 +1,4 @@
#!bin/sh
if [[ $(pgrep dwmblocks | wc -l) > 0 ]]; then
exec /home/swebb/Scripts/dwm/reset.sh
fi

22
dwm/ubright.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
case $1 in
up)
if [ $(brightnessctl -d intel_backlight get) -lt 1200 ]; then
brightnessctl -d intel_backlight set 10%
else
brightnessctl -d intel_backlight set 10%+
fi;;
down)
brightnessctl -d intel_backlight set 10%-;;
max)
brightnessctl -d intel_backlight set 100%;;
min)
brightnessctl -d intel_backlight set 1;;
red)
redshift -O 3000k;;
white)
redshift -x;;
esac
kill -47 $(pidof dwmblocks)

12
dwm/uspotify.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
case $1 in
next)
$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next);;
prev)
$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous);;
playpause)
$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause);;
esac
kill -39 $(pidof dwmblocks)

16
dwm/uvolume.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
case $1 in
toggle)
amixer set 'Master' toggle;;
up)
amixer set 'Master' 3+;;
down)
amixer set 'Master' 3-;;
max)
amixer set 'Master' 87;;
min)
amixer set 'Master' 43;;
esac
kill -40 $(pidof dwmblocks)

28
dwm/volume.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/volumeMenu.sh;;
3) /home/swebb/Scripts/dwm/uvolume.sh toggle;;
esac
mute=$(amixer get Master | sed -n 5p | sed -E 's/.*\[//;s/\]//')
volume=$(amixer get Master | sed -n 5p | sed -E 's/[^\[]*\[//;s/\].*//')
head=$(amixer | grep -m 1 'Front Right:' | sed -E 's/.+\[/[/')
icon=""
case $mute in
on)
mute="^c#bbbbbb^"
if [ $head == "[off]" ]; then
icon=""
fi
;;
off)
mute="^c#F75341^"
if [ $head == "[off]" ]; then
icon=""
fi
;;
esac
echo "${mute}${icon} ${volume}"

5
dwm/volumeMenu.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cat <<EOF | xmenu -p 1345x20 | sh &
Audio Mixer (pavucontrol) pavucontrol
EOF

17
dwm/wlan.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/wlanMenu.sh;;
esac
conn=$(nmcli device show | sed -n 1p | sed -E 's/.*:\s*//')
case $conn in
wlp2s0)
icon="";;
enp1s0)
icon="";;
esac
echo "^c#FF5C8F^ ${icon} $(nmcli device show | sed -n 6p | sed -E 's/.*:\s*//')"

6
dwm/wlanMenu.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
cat <<EOF | xmenu -p 1550x20 | sh &
Connection GUI ~/Scripts/mschapv2.sh &
Speed Test st -e speedtest++ &
EOF

70
dwm_status.sh Executable file
View file

@ -0,0 +1,70 @@
#!/bin/sh
# NOW PLAYING
spotify=""
if [ $(ps aux | grep 'Spotify' | head -n -1 | wc -l) -gt 1 ]
then
artist="$(sp metadata | grep -E 'artist\|' | sed -E 's/artist\|//')"
title="$(sp metadata | grep -E 'title' | sed -E 's/title\|//')"
album="$(sp metadata | grep -E 'album\|' | sed -E 's/album\|//')"
spotify="${artist} - ${title} [${album}] |"
if [ ${artist} == "xesam:artist" ]
then
spotify=" 阮 |"
fi
fi
# USB
usb=""
if [ $(lsusb | grep 'Google' | wc -l) == 1 ]
then
usb="ﲎ |"
fi
# CPU MHZ
# cpu="$(cat /proc/cpuinfo | grep MHz | awk '{sum +=$4} END {printf("%.1f"),sum/9000}')"
# RAM
# ram=" $(free -m | grep Mem | awk '{printf("%.2f",$3/$2 * 100)}')"
# VOLUME
volume="婢 "
if [ $(amixer get Master | awk -F"[][]" '/Mono:/ { print $6 }') = "on" ]
then
volume="墳 "
fi
volume="${volume}$(amixer get Master | awk -F"[][]" '/Mono:/ { print $2}')"
# SCREEN BRIGHTNESS
light="$(awk "BEGIN { print $(brightnessctl -d intel_backlight get)/1200}")%"
if [ $(brightnessctl -d intel_backlight get) -eq 1 ]
then
light=" Minimum"
fi
# BATTERY
battery=" "
if [ $(cat /sys/class/power_supply/BAT0/status) = "Charging" ]
then
battery="ﴞ "
fi
battery="${battery}$(cat /sys/class/power_supply/BAT0/capacity)%"
# DISK SPACE
disk="$(df /dev/nvme0n1p8 | awk '{print $5}' | tail -n 1)"
# NETWORK ACCESS
network="$(nmcli device show | sed -n 6p | sed 's/GENERAL.CONNECTION:\s*//')"
echo " $usb$spotify $volume $light $battery $disk $network | $( date +%A", "%D" | "%R) "

4
mschapv2.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
nm-applet 2>&1 > /dev/null &
stalonetray 2>&1 > /dev/null
killall nm-applet

24
scriptDrafts/dwm-bright.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
case $1 in
up)
if [ $(brightnessctl -d intel_backlight get) -le 1200 ]
then
brightnessctl -d intel_backlight set 10%
else
brightnessctl -d intel_backlight set 10%+
fi
;;
down)
brightnessctl -d intel_backlight set 10%-
;;
min)
brightnessctl -d intel_backlight set 1
;;
max)
brightnessctl -d intel_backlight set 100%
;;
esac
#kill -48 $(pidof dwmblocks)

3
scriptDrafts/dwm-charge.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
dunstify "Help"

3
scriptDrafts/dwm-ctrl.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
dunstify "Control"

5
scriptDrafts/dwm-date.sh Executable file
View file

@ -0,0 +1,5 @@
#!bin/sh
dunstify "$(cal)"
kill -44 $(pidof dwmblocks)

21
scriptDrafts/dwm-spotify.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
# Line to use to get the position of the song refer to link for other properties
# https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html
# dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Position'
case $1 in
prev)
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
;;
toggle)
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
;;
next)
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
;;
esac
kill -39 $(pidof dwmblocks)

21
scriptDrafts/dwm-volume.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
case $1 in
up)
amixer set 'Master' 2%+
;;
down)
amixer set 'Master' 2%-
;;
max)
amixer set 'Master' 100%
;;
min)
amixer set 'Master' 1%
;;
toggle)
amixer set 'Master' toggle
;;
esac
kill -40 $(pidof dwmblocks)

5
tbk.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
num=$(ls ~/Pictures/Screenshots | wc -l)
imlib2_grab ~/Pictures/Screenshots/Screenshot${num}.jpg
herbe "Screenshot #${num} saved"

7
wallpaper.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
if [ $(($RANDOM%2)) -eq 0 ]; then
feh --bg-center --randomize ~/Pictures/Wallpapers/center/*
else
feh --bg-fill --randomize ~/Pictures/Wallpapers/fill/*
fi