Some work on Scripts
notable changes: - rename `bt-connect` to `bt_connect` - rename `music` to `media` and make it generic instead of checking Spotify - make separate script to set background to a preset black image - make all shebangs "#!/usr/bin/env sh"
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
feh --bg-fill --randomize $HOME/Pictures/Backgrounds;
|
||||
# feh --bg-fill $HOME/Pictures/Backgrounds/black.jpg;
|
||||
|
||||
3
Scripts/.local/scripts/black-bg
Executable file
3
Scripts/.local/scripts/black-bg
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
feh --bg-fill $HOME/Pictures/Backgrounds/black-nice.jpg;
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
response=$(cat $HOME/.local/share/emoticons.txt | dmenu -F -i)
|
||||
emoticon=$(echo $response | sed 's/\w+//gi' | awk '{print $1}')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
P=$HOME
|
||||
#!/usr/bin/env sh
|
||||
|
||||
sudo xboxdrv --silent \
|
||||
-c $P/.config/xboxdrv/general.xboxdrv \
|
||||
--alt-config $P/.config/xboxdrv/typing.xboxdrv \
|
||||
--alt-config $P/.config/xboxdrv/media.xboxdrv \
|
||||
-c $HOME/.config/xboxdrv/general.xboxdrv \
|
||||
--alt-config $HOME/.config/xboxdrv/typing.xboxdrv \
|
||||
--alt-config $HOME/.config/xboxdrv/media.xboxdrv \
|
||||
--axis-sensitivity X1=-1.0,X2=-1.0,Y1=-1.0,Y2=-1.0
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
killall xinit;
|
||||
|
||||
@@ -27,7 +27,7 @@ choice=$(ssh oreo@oldboy "find /media/hdd/content/ -type 'f' $filtering" |\
|
||||
sed "s/\/media\/hdd\/content\/$selection/\1/g" |\
|
||||
dmenu -i -l 5 -p "Choose file: ")
|
||||
|
||||
if [ $1 == "-f" ]
|
||||
if [ $1 = "-f" ]
|
||||
then
|
||||
mpv "sftp://oldboy:/media/hdd/content/$choice$ending"
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
choice=$(mpc playlist | dmenu -i)
|
||||
if [[ -n "$choice" ]]
|
||||
then
|
||||
@@ -7,4 +7,3 @@ then
|
||||
else
|
||||
echo "No choice given"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
wget -nv --show-progress -O /dev/null "https://aryadevchavali.com/resources/Table-of-Integrals.pdf"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# From https://github.com/LukeSmithxyz/st
|
||||
|
||||
urlregex="(((http|https|gopher|gemini|ftp|ftps|git)://|www\\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# From https://github.com/LukeSmithxyz/st
|
||||
|
||||
# By Jaywalker and Luke
|
||||
|
||||
@@ -1,37 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
script=""
|
||||
case "$(printf "Date\nBattery\nBrightness\nBluetooth\nMusic\nNetwork\nVolume\nTemperature\nMemory\nUptime" | dmenu -i -p "Select: ")" in
|
||||
"Date")
|
||||
script="datetime"
|
||||
;;
|
||||
"Battery")
|
||||
script="battery"
|
||||
;;
|
||||
"Brightness")
|
||||
script="brightness"
|
||||
;;
|
||||
"Bluetooth")
|
||||
script="bluetooth-status"
|
||||
;;
|
||||
"Music")
|
||||
script="music"
|
||||
;;
|
||||
"Network")
|
||||
script="connection"
|
||||
;;
|
||||
"Volume")
|
||||
script="volume"
|
||||
;;
|
||||
"Temperature")
|
||||
script="temperature"
|
||||
;;
|
||||
"Memory")
|
||||
script="memory"
|
||||
;;
|
||||
"Uptime")
|
||||
script="uptime_status"
|
||||
;;
|
||||
choices="Date\nBattery\nBrightness\nBluetooth\nMedia\nNetwork\nVolume\nTemperature\nMemory\nUptime"
|
||||
choice=$(printf $choices | dmenu -i -p "Select: ")
|
||||
|
||||
case $choice in
|
||||
"Date") script="datetime" ;;
|
||||
"Battery") script="battery" ;;
|
||||
"Brightness") script="brightness" ;;
|
||||
"Bluetooth") script="bluetooth-status" ;;
|
||||
"Media") script="media" ;;
|
||||
"Network") script="connection" ;;
|
||||
"Volume") script="volume" ;;
|
||||
"Temperature") script="temperature" ;;
|
||||
"Memory") script="memory" ;;
|
||||
"Uptime") script="uptime_status" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
||||
notify-send -u low "$(~/.local/scripts/status/$script)"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
name=$(bluetoothctl info | grep "Name" | sed 's/.*Name: //')
|
||||
battery=$(bluetoothctl info | grep "Battery" | sed 's/.*(//;s/)//')
|
||||
name=$(bluetoothctl info | grep "Alias" | sed 's/.*Alias: //')
|
||||
battery=$(bluetoothctl info | grep "Battery Percentage" | sed 's/.*(//;s/)//')
|
||||
if [ ! "$name" ]
|
||||
then
|
||||
echo ""
|
||||
|
||||
4
Scripts/.local/scripts/status/media
Executable file
4
Scripts/.local/scripts/status/media
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
title=$(playerctl metadata title)
|
||||
echo " $title"
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
line=$(free -m | sed -n 2p);
|
||||
used=$(echo $line | awk '{print $3}');
|
||||
available=$(echo $line | awk '{print $2}');
|
||||
value=$(echo "100 * $used / $available" | bc -l | xargs printf "%.2f" $1)
|
||||
|
||||
echo "⾝ $(printf "%dMB" $used) $value%"
|
||||
echo "㊎ $(printf "%dMB" $used) $value%"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
title=$(playerctl --player=spotify metadata title | cut -c 1-30)
|
||||
echo " $title"
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
while :
|
||||
do
|
||||
prev="$(playerctl --player=spotify metadata title)"
|
||||
item=$prev
|
||||
while [[ $item == $prev ]]
|
||||
do
|
||||
item="$(playerctl --player=spotify metadata title)";
|
||||
sleep 0.5;
|
||||
done
|
||||
kill -37 $(pidof dwmblocks);
|
||||
item="";
|
||||
done
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
systemctl --user $@
|
||||
|
||||
Reference in New Issue
Block a user