Move .scripts -> .local/bin

This commit is contained in:
Riyyi
2021-02-25 20:16:07 +01:00
parent 3ac7d9f601
commit ba10984084
40 changed files with 93 additions and 94 deletions
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
for m in `bspc query -M`; do
bspc monitor $m -d \
"$WS1" "$WS2" "$WS3" "$WS4" "$WS5" \
"$WS6" "$WS7" "$WS8" "$WS9" "$WS0"
done
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
# Enable mathematics in POSIX shell
calc() { awk "BEGIN{print $*}"; }
# Calculate size
MON_WIDTH=$(xdotool getdisplaygeometry | awk '{print $1}')
MON_HEIGHT=$(xdotool getdisplaygeometry | awk '{print $2}')
NEW_WIDTH=$(calc "$MON_WIDTH * 0.2")
NEW_HEIGHT=$(calc "$NEW_WIDTH / 16 * 9")
# Calculate position
BORDER=23
X=$(calc "$MON_WIDTH - $NEW_WIDTH - $BORDER")
Y=$(calc "$MON_HEIGHT - $NEW_HEIGHT - $BORDER")
# Set window
CURRENT=$(xdotool getwindowfocus)
xdotool windowsize "$CURRENT" "$NEW_WIDTH" "$NEW_HEIGHT"
xdotool windowmove "$CURRENT" "$X" "$Y"
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+47
View File
@@ -0,0 +1,47 @@
#!/bin/sh
LOCK="$XDG_CACHE_HOME/lock.png"
# Cache the lock image
if [ ! -f "$LOCK" ]; then
touch "$LOCK"
# Get the resolution of the primary monitor
RES="$(xrandr -q | grep ' connected primary' \
| grep -Eo '[0-9]{3,4}x[0-9]{3,4}' | head -c -1)"
# Generate lock image
convert "$(dirname "$0")/lock.png" -background none -gravity center -extent "$RES" "$LOCK"
fi
# Disable screensaver
revert() {
xset s off
xset -dpms
}
# Set screensaver to 30 seconds
trap revert HUP INT TERM
xset +dpms dpms 30 30 30
i3lock -n -i "$LOCK" -B 6 -S 1 -e \
--radius=47 \
--ring-width=5.0 \
--verifcolor=00000000 \
--wrongcolor=00000000 \
--timecolor=00000000 \
--datecolor=00000000 \
--layoutcolor=00000000 \
--insidecolor=00000000 \
--insidevercolor=00000000 --insidewrongcolor=00000000 \
--ringcolor=00000000 \
--ringvercolor=FFFFFFC0 --ringwrongcolor=DA2825C0 \
--keyhlcolor=FFFFFFC0 --bshlcolor=DA2825C0 \
--linecolor=00000000 --separatorcolor=00000000 \
-k \
--timesize=64 --datesize=24 \
--timestr="%I:%M %p" --datestr="%A, %B %e" \
--timepos="ix:iy-250" --datepos="ix:iy-200" \
--timecolor=FFFFFFC0 --datecolor=FFFFFFC0
revert
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# Overwrite wallpaper with new image if provided
[ -n "$1" ] && cp "$1" "$HOME/pictures/wallpaper.jpg"
# Set wallpaper
feh --no-fehbg --bg-fill "$HOME/pictures/wallpaper.jpg"