mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
wtf
This commit is contained in:
parent
e8058abc7d
commit
a161a5ee82
@ -1,11 +0,0 @@
|
|||||||
# Important Note
|
|
||||||
|
|
||||||
These cronjobs have components that require information about your current display to display notifications correctly.
|
|
||||||
|
|
||||||
When you add them as cronjobs, I recommend you precede the command with commands as those below:
|
|
||||||
|
|
||||||
```
|
|
||||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus; export DISPLAY=:0; . $HOME/.zprofile; then_command_goes_here
|
|
||||||
```
|
|
||||||
|
|
||||||
This ensures that notifications will display, xdotool commands will function and environmental variables will work as well.
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Syncs repositories and downloads updates, meant to be run as a cronjob.
|
|
||||||
|
|
||||||
notify-send "📦 Repository Sync" "Checking for package updates..."
|
|
||||||
|
|
||||||
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
|
|
||||||
|
|
||||||
Check your internet connection, if pacman is already running, or run update manually to see errors."
|
|
||||||
pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
|
|
||||||
|
|
||||||
if pacman -Qu | grep -v "\[ignored\]"
|
|
||||||
then
|
|
||||||
notify-send "🎁 Repository Sync" "Updates available. Click statusbar icon (📦) for update."
|
|
||||||
else
|
|
||||||
notify-send "📦 Repository Sync" "Sync complete. No new packages for update."
|
|
||||||
fi
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Toggles all cronjobs off/on.
|
|
||||||
# Stores disabled crontabs in ~/.consaved until restored.
|
|
||||||
|
|
||||||
([ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved ] && crontab - < "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && rm "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.")
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Set as a cron job to check for new RSS entries for newsboat.
|
|
||||||
# If newsboat is open, sends it an "R" key to refresh.
|
|
||||||
|
|
||||||
/usr/bin/notify-send "📰 Updating RSS feeds..."
|
|
||||||
|
|
||||||
pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name "^newsboat$")" R && exit
|
|
||||||
|
|
||||||
echo 🔃 > /tmp/newsupdate
|
|
||||||
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
|
|
||||||
/usr/bin/newsboat -x reload
|
|
||||||
rm -f /tmp/newsupdate
|
|
||||||
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
|
|
||||||
/usr/bin/notify-send "📰 RSS feed update complete."
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Gives a dmenu prompt to mount unmounted local NAS shares for read/write.
|
|
||||||
# Requirements - "%wheel ALL=(ALL) NOPASSWD: ALL"
|
|
||||||
#
|
|
||||||
# Browse for mDNS/DNS-SD services using the Avahi daemon...
|
|
||||||
srvname=$(avahi-browse _smb._tcp -t | awk '{print $4}' | dmenu -i -p "Which NAS?") || exit 1
|
|
||||||
notify-send "Searching for network shares..." "Please wait..."
|
|
||||||
# Choose share disk...
|
|
||||||
share=$(smbclient -L "$srvname" -N | grep Disk | awk '{print $1}' | dmenu -i -p "Mount which share?") || exit 1
|
|
||||||
# Format URL...
|
|
||||||
share2mnt=//"$srvname".local/"$share"
|
|
||||||
|
|
||||||
sharemount() {
|
|
||||||
mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share")
|
|
||||||
[ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0
|
|
||||||
notify-send "Netshare $share already mounted"; exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
sharemount
|
|
||||||
@ -1,123 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Usage:
|
|
||||||
# `$0`: Ask for recording type via dmenu
|
|
||||||
# `$0 screencast`: Record both audio and screen
|
|
||||||
# `$0 video`: Record only screen
|
|
||||||
# `$0 audio`: Record only audio
|
|
||||||
# `$0 kill`: Kill existing recording
|
|
||||||
#
|
|
||||||
# If there is already a running instance, user will be prompted to end it.
|
|
||||||
|
|
||||||
updateicon() { \
|
|
||||||
echo "$1" > /tmp/recordingicon
|
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
|
||||||
}
|
|
||||||
|
|
||||||
killrecording() {
|
|
||||||
recpid="$(cat /tmp/recordingpid)"
|
|
||||||
# kill with SIGTERM, allowing finishing touches.
|
|
||||||
kill -15 "$recpid"
|
|
||||||
rm -f /tmp/recordingpid
|
|
||||||
updateicon ""
|
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
|
||||||
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
|
||||||
sleep 3
|
|
||||||
kill -9 "$recpid"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
screencast() { \
|
|
||||||
ffmpeg -y \
|
|
||||||
-f x11grab \
|
|
||||||
-framerate 60 \
|
|
||||||
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
|
||||||
-i "$DISPLAY" \
|
|
||||||
-f alsa -i default \
|
|
||||||
-r 30 \
|
|
||||||
-c:v h264 -crf 0 -preset ultrafast -c:a aac \
|
|
||||||
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️🎙️"
|
|
||||||
}
|
|
||||||
|
|
||||||
video() { ffmpeg \
|
|
||||||
-f x11grab \
|
|
||||||
-s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \
|
|
||||||
-i "$DISPLAY" \
|
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
|
||||||
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️"
|
|
||||||
}
|
|
||||||
|
|
||||||
webcamhidef() { ffmpeg \
|
|
||||||
-f v4l2 \
|
|
||||||
-i /dev/video0 \
|
|
||||||
-video_size 1920x1080 \
|
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎥"
|
|
||||||
}
|
|
||||||
|
|
||||||
webcam() { ffmpeg \
|
|
||||||
-f v4l2 \
|
|
||||||
-i /dev/video0 \
|
|
||||||
-video_size 640x480 \
|
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎥"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
audio() { \
|
|
||||||
ffmpeg \
|
|
||||||
-f alsa -i default \
|
|
||||||
-c:a flac \
|
|
||||||
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎙️"
|
|
||||||
}
|
|
||||||
|
|
||||||
askrecording() { \
|
|
||||||
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
|
||||||
case "$choice" in
|
|
||||||
screencast) screencast;;
|
|
||||||
audio) audio;;
|
|
||||||
video) video;;
|
|
||||||
*selected) videoselected;;
|
|
||||||
webcam) webcam;;
|
|
||||||
"webcam (hi-def)") webcamhidef;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
asktoend() { \
|
|
||||||
response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
|
|
||||||
[ "$response" = "Yes" ] && killrecording
|
|
||||||
}
|
|
||||||
|
|
||||||
videoselected()
|
|
||||||
{
|
|
||||||
slop -f "%x %y %w %h" > /tmp/slop
|
|
||||||
read -r X Y W H < /tmp/slop
|
|
||||||
rm /tmp/slop
|
|
||||||
|
|
||||||
ffmpeg \
|
|
||||||
-f x11grab \
|
|
||||||
-framerate 60 \
|
|
||||||
-video_size "$W"x"$H" \
|
|
||||||
-i :0.0+"$X,$Y" \
|
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
|
||||||
"$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
screencast) screencast;;
|
|
||||||
audio) audio;;
|
|
||||||
video) video;;
|
|
||||||
*selected) videoselected;;
|
|
||||||
kill) killrecording;;
|
|
||||||
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
|
|
||||||
esac
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# A dmenu prompt to unmount drives.
|
|
||||||
# Provides you with mounted partitions, select one to unmount.
|
|
||||||
# Drives mounted at /, /boot and /home will not be options to unmount.
|
|
||||||
|
|
||||||
unmountusb() {
|
|
||||||
[ -z "$drives" ] && exit
|
|
||||||
chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
|
|
||||||
chosen="$(echo "$chosen" | awk '{print $1}')"
|
|
||||||
[ -z "$chosen" ] && exit
|
|
||||||
sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted."
|
|
||||||
}
|
|
||||||
|
|
||||||
unmountandroid() { \
|
|
||||||
chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1
|
|
||||||
[ -z "$chosen" ] && exit
|
|
||||||
sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
|
|
||||||
}
|
|
||||||
|
|
||||||
asktype() { \
|
|
||||||
choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1
|
|
||||||
case "$choice" in
|
|
||||||
USB) unmountusb ;;
|
|
||||||
Android) unmountandroid ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
|
|
||||||
|
|
||||||
if ! grep simple-mtpfs /etc/mtab; then
|
|
||||||
[ -z "$drives" ] && echo "No drives to unmount." && exit
|
|
||||||
echo "Unmountable USB drive detected."
|
|
||||||
unmountusb
|
|
||||||
else
|
|
||||||
if [ -z "$drives" ]
|
|
||||||
then
|
|
||||||
echo "Unmountable Android device detected."
|
|
||||||
unmountandroid
|
|
||||||
else
|
|
||||||
echo "Unmountable USB drive(s) and Android device(s) detected."
|
|
||||||
asktype
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# The famous "get a menu of emojis to copy" script.
|
|
||||||
|
|
||||||
# Get user selection via dmenu from emoji file.
|
|
||||||
chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*//")
|
|
||||||
|
|
||||||
# Exit if none chosen.
|
|
||||||
[ -z "$chosen" ] && exit
|
|
||||||
|
|
||||||
# If you run this command with an argument, it will automatically insert the
|
|
||||||
# character. Otherwise, show a message that the emoji has been copied.
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
xdotool type "$chosen"
|
|
||||||
else
|
|
||||||
printf "$chosen" | xclip -selection clipboard
|
|
||||||
notify-send "'$chosen' copied to clipboard." &
|
|
||||||
fi
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit
|
|
||||||
|
|
||||||
if [ -f "$1" ]; then
|
|
||||||
# Try to get DOI from pdfinfo or pdftotext output.
|
|
||||||
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
|
|
||||||
doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1) ||
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
doi="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check crossref.org for the bib citation.
|
|
||||||
curl -s "https://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n"
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cat "${XDG_DATA_HOME:-$HOME/.local/share}"/larbs/getkeys/"$1" 2>/dev/null && exit
|
|
||||||
echo "Run command with one of the following arguments for info about that program:"
|
|
||||||
ls "${XDG_DATA_HOME:-$HOME/.local/share}"/larbs/getkeys
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Some optional functions in LARBS require programs not installed by default. I
|
|
||||||
# use this little script to check to see if a command exists and if it doesn't
|
|
||||||
# it informs the user that they need that command to continue. This is used in
|
|
||||||
# various other scripts for clarity's sake.
|
|
||||||
|
|
||||||
for x in "$@"; do
|
|
||||||
if ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1; then
|
|
||||||
notify-send "📦 $x" "must be installed for this function." && exit 1 ;
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Reads file names from stdin and selects them in lf.
|
|
||||||
|
|
||||||
while read -r file; do
|
|
||||||
[ -z "$file" ] && continue
|
|
||||||
lf -remote "send select \"$file\""
|
|
||||||
lf -remote "send toggle"
|
|
||||||
done
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Feed script a url or file location.
|
|
||||||
# If an image, it will view in sxiv,
|
|
||||||
# if a video or gif, it will view in mpv
|
|
||||||
# if a music file or pdf, it will download,
|
|
||||||
# otherwise it opens link in browser.
|
|
||||||
|
|
||||||
# If no url given. Opens browser. For using script as $BROWSER.
|
|
||||||
[ -z "$1" ] && { "$BROWSER"; exit; }
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
|
||||||
setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;;
|
|
||||||
*png|*jpg|*jpe|*jpeg|*gif)
|
|
||||||
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
|
||||||
*pdf|*cbz|*cbr)
|
|
||||||
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
|
|
||||||
*mp3|*flac|*opus|*mp3?source*)
|
|
||||||
qndl "$1" 'curl -LO' >/dev/null 2>&1 ;;
|
|
||||||
*)
|
|
||||||
[ -f "$1" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$1" >/dev/null 2>&1 || setsid -f "$BROWSER" "$1" >/dev/null 2>&1
|
|
||||||
esac
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# This is bound to Shift+PrintScreen by default, requires maim. It lets you
|
|
||||||
# choose the kind of screenshot to take, including copying the image or even
|
|
||||||
# highlighting an area to copy. scrotcucks on suicidewatch right now.
|
|
||||||
|
|
||||||
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
|
|
||||||
"a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
|
||||||
"current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
|
||||||
"full screen") maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
|
|
||||||
"a selected area (copy)") maim -s | xclip -selection clipboard -t image/png ;;
|
|
||||||
"current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
|
|
||||||
"full screen (copy)") maim | xclip -selection clipboard -t image/png ;;
|
|
||||||
esac
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
#!/usr/bin/sh
|
|
||||||
|
|
||||||
usage ()
|
|
||||||
{
|
|
||||||
printf "Usage : noisereduce <input video file> <output video file>\n"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
# Tests for requirements
|
|
||||||
ifinstalled ffmpeg || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; }
|
|
||||||
ifinstalled sox || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; }
|
|
||||||
|
|
||||||
if [ "$#" -ne 2 ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "$1" ]
|
|
||||||
then
|
|
||||||
printf "File not found: %s\n" "$1"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "$2" ]
|
|
||||||
then
|
|
||||||
printf "File %s already exists, overwrite? [y/N]\n: " "$2"
|
|
||||||
read -r yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* ) ;;
|
|
||||||
* ) exit;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
inBasename=$(basename "$1")
|
|
||||||
inExt="${inBasename##*.}"
|
|
||||||
|
|
||||||
isVideoStr=$(ffprobe -v warning -show_streams "$1" | grep codec_type=video)
|
|
||||||
if [ -n "$isVideoStr" ]
|
|
||||||
then
|
|
||||||
isVideo=1
|
|
||||||
printf "Detected %s as a video file\n" "$inBasename"
|
|
||||||
else
|
|
||||||
isVideo=0
|
|
||||||
printf "Detected %s as an audio file\n" "$inBasename"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "Sample noise start time [00:00:00]: "
|
|
||||||
read -r sampleStart
|
|
||||||
if [ -z "$sampleStart" ] ; then sampleStart="00:00:00"; fi
|
|
||||||
printf "Sample noise end time [00:00:00.900]: "
|
|
||||||
read -r sampleEnd
|
|
||||||
if [ -z "$sampleEnd" ] ; then sampleEnd="00:00:00.900"; fi
|
|
||||||
printf "Noise reduction amount [0.21]: "
|
|
||||||
read -r sensitivity
|
|
||||||
if [ -z "$sensitivity" ] ; then sensitivity="0.21"; fi
|
|
||||||
|
|
||||||
|
|
||||||
tmpVidFile="/tmp/noiseclean_tmpvid.$inExt"
|
|
||||||
tmpAudFile="/tmp/noiseclean_tmpaud.wav"
|
|
||||||
noiseAudFile="/tmp/noiseclean_noiseaud.wav"
|
|
||||||
noiseProfFile="/tmp/noiseclean_noise.prof"
|
|
||||||
tmpAudCleanFile="/tmp/noiseclean_tmpaud-clean.wav"
|
|
||||||
|
|
||||||
printf "Cleaning noise on %s...\n" "$1"
|
|
||||||
|
|
||||||
if [ $isVideo -eq "1" ]; then
|
|
||||||
ffmpeg -v warning -y -i "$1" -qscale:v 0 -vcodec copy -an "$tmpVidFile"
|
|
||||||
ffmpeg -v warning -y -i "$1" -qscale:a 0 "$tmpAudFile"
|
|
||||||
else
|
|
||||||
cp "$1" "$tmpAudFile"
|
|
||||||
fi
|
|
||||||
ffmpeg -v warning -y -i "$1" -vn -ss "$sampleStart" -t "$sampleEnd" "$noiseAudFile"
|
|
||||||
sox "$noiseAudFile" -n noiseprof "$noiseProfFile"
|
|
||||||
sox "$tmpAudFile" "$tmpAudCleanFile" noisered "$noiseProfFile" "$sensitivity"
|
|
||||||
if [ $isVideo -eq "1" ]; then
|
|
||||||
ffmpeg -v warning -y -i "$tmpAudCleanFile" -i "$tmpVidFile" -vcodec copy -qscale:v 0 -qscale:a 0 "$2"
|
|
||||||
else
|
|
||||||
cp "$tmpAudCleanFile" "$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "Done"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# opout: "open output": A general handler for opening a file's intended output,
|
|
||||||
# usually the pdf of a compiled document. I find this useful especially
|
|
||||||
# running from vim.
|
|
||||||
|
|
||||||
basename="${1%.*}"
|
|
||||||
|
|
||||||
case "${*}" in
|
|
||||||
*.tex|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;;
|
|
||||||
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
|
|
||||||
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
|
|
||||||
esac
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Get a one-time password, or add a OTP secret to your pass-otp store.
|
|
||||||
|
|
||||||
# The assumption of this script is that all otp passwords are stored with the
|
|
||||||
# suffix `-otp`. This script automatically appends newly added otps as such.
|
|
||||||
|
|
||||||
# For OTP passwords to be generated properly, it is important for the local
|
|
||||||
# computer to have its time properly synced. This can be done with the command
|
|
||||||
# below which requires the package `ntp`.
|
|
||||||
|
|
||||||
ifinstalled pass pass-otp
|
|
||||||
|
|
||||||
dir="${PASSWORD_STORE_DIR}"
|
|
||||||
|
|
||||||
choice="$({ echo "🆕add" ; echo "🕙sync-time" ; ls ${dir}/*-otp.gpg ;} | sed "s/.*\///;s/-otp.gpg//" | dmenu -p "Pick a 2FA:")"
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
🆕add )
|
|
||||||
ifinstalled maim zbar xclip || exit 1
|
|
||||||
|
|
||||||
temp="$dir/temp.png"
|
|
||||||
otp="otp-test-script"
|
|
||||||
trap 'shred -fu $temp; pass rm $otp' HUP INT QUIT TERM PWR EXIT
|
|
||||||
|
|
||||||
notify-send "Scan the image." "Scan the OTP QR code."
|
|
||||||
|
|
||||||
maim -s "$temp" || exit 1
|
|
||||||
info="$(zbarimg -q "$temp")"
|
|
||||||
info="${info#QR-Code:}"
|
|
||||||
issuer="$(echo "$info" | grep -o "issuer=[A-z0-9]\+")"
|
|
||||||
name="${issuer#issuer=}"
|
|
||||||
|
|
||||||
if echo "$info" | pass otp insert "$otp"; then
|
|
||||||
while true ; do
|
|
||||||
export name="$(prinf | dmenu -p "Give this One Time Password a one-word name:")"
|
|
||||||
echo "$name" | grep -q -- "^[A-z0-9-]\+$" && break
|
|
||||||
done
|
|
||||||
pass mv "$otp" "$name-otp"
|
|
||||||
notify-send "Successfully added." "$name-otp has been created."
|
|
||||||
else
|
|
||||||
notify-send "No OTP data found." "Try to scan the image again more precisely."
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
🕙sync-time )
|
|
||||||
ifinstalled ntp || exit 1
|
|
||||||
notify-send -u low "🕙 Synchronizing Time..." "Synching time with remote NTP servers..."
|
|
||||||
updatedata="$(sudo ntpdate pool.ntp.org)" &&
|
|
||||||
notify-send -u low "🕙 Synchronizing Time..." "Done. Time changed by ${updatedata#*offset }"
|
|
||||||
;;
|
|
||||||
*) pass otp -c ${choice}-otp ;;
|
|
||||||
esac
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# You might notice all mpv commands are aliased to have this input-ipc-server
|
|
||||||
# thing. That's just for this particular command, which allows us to pause
|
|
||||||
# every single one of them with one command! This is bound to super + shift + p
|
|
||||||
# (with other things) by default and is used in some other places.
|
|
||||||
|
|
||||||
for i in $(ls /tmp/mpvSockets/*); do
|
|
||||||
echo '{ "command": ["set_property", "pause", true] }' | socat - "$i";
|
|
||||||
done
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# torrent peertube videos, requires the transadd script
|
|
||||||
# first argument is the video link, second is the quality (480 or 1080)
|
|
||||||
# 13/07/20 - Arthur Bais
|
|
||||||
|
|
||||||
link="$(echo "$1" | sed "s/w/download\/torrents/")""-$2.torrent"
|
|
||||||
transadd "$link"
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# entr command to run `queueandnotify` when newsboat queue is changed
|
|
||||||
|
|
||||||
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
|
|
||||||
|
|
||||||
echo "${XDG_DATA_HOME:-$HOME/.local/share}"/newsboat/queue | entr -p queueandnotify 2>/dev/null
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# A dmenu binary prompt script.
|
|
||||||
# Gives a dmenu prompt labeled with $1 to perform command $2.
|
|
||||||
# For example:
|
|
||||||
# `./prompt "Do you want to shutdown?" "shutdown -h now"`
|
|
||||||
|
|
||||||
[ "$(printf "No\\nYes" | dmenu -i -p "$1" -nb darkred -sb red -sf white -nf gray )" = "Yes" ] && $2
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# $1 is a url; $2 is a command
|
|
||||||
[ -z "$1" ] && exit
|
|
||||||
base="$(basename "$1")"
|
|
||||||
notify-send "⏳ Queuing $base..."
|
|
||||||
cmd="$2"
|
|
||||||
[ -z "$cmd" ] && cmd="youtube-dl --add-metadata -ic"
|
|
||||||
idnum="$(tsp $cmd "$1")"
|
|
||||||
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
|
|
||||||
tsp -D "$idnum" mv "$base" "$realname"
|
|
||||||
tsp -D "$idnum" notify-send "👍 $realname done."
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Podboat sucks. This script replaces it.
|
|
||||||
# It reads the newsboat queue, queuing downloads with taskspooler.
|
|
||||||
# It also removes the junk from extentions.
|
|
||||||
queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue"
|
|
||||||
|
|
||||||
while read -r line; do
|
|
||||||
[ -z "$line" ] && continue
|
|
||||||
url="${line%%[ ]*}"
|
|
||||||
qndl "$url" "curl -LO"
|
|
||||||
done < "$queuefile"
|
|
||||||
|
|
||||||
echo > "$queuefile"
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# This script is called on startup to remap keys.
|
|
||||||
# Increase key speed via a rate change
|
|
||||||
xset r rate 300 50
|
|
||||||
# Map the caps lock key to super...
|
|
||||||
setxkbmap -option caps:super
|
|
||||||
# But when it is pressed only once, treat it as escape.
|
|
||||||
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
|
|
||||||
# Map the menu button to right super as well.
|
|
||||||
xmodmap -e 'keycode 135 = Super_R'
|
|
||||||
# Turn off the caps lock if on since there is no longer a key for it.
|
|
||||||
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# When I open an image from the file manager in sxiv (the image viewer), I want
|
|
||||||
# to be able to press the next/previous keys to key through the rest of the
|
|
||||||
# images in the same directory. This script "rotates" the content of a
|
|
||||||
# directory based on the first chosen file, so that if I open the 15th image,
|
|
||||||
# if I press next, it will go to the 16th etc. Autistic, I know, but this is
|
|
||||||
# one of the reasons that sxiv is great for being able to read standard input.
|
|
||||||
|
|
||||||
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
|
||||||
base="$(basename "$1")"
|
|
||||||
ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Open a terminal window in the same directory as the currently active window.
|
|
||||||
|
|
||||||
PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
|
|
||||||
PID="$(pstree -lpA "$PID")"
|
|
||||||
PID="${PID##*(}"
|
|
||||||
PID="${PID%)}"
|
|
||||||
cd "$(readlink /proc/"$PID"/cwd)" || return 1
|
|
||||||
"$TERMINAL"
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs"
|
|
||||||
bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
|
|
||||||
|
|
||||||
# Output locations. Unactivated progs should go to /dev/null.
|
|
||||||
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
|
||||||
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
|
||||||
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
|
||||||
ranger_shortcuts="/dev/null"
|
|
||||||
qute_shortcuts="/dev/null"
|
|
||||||
fish_shortcuts="/dev/null"
|
|
||||||
vifm_shortcuts="/dev/null"
|
|
||||||
|
|
||||||
# Remove, prepare files
|
|
||||||
rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null
|
|
||||||
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
|
||||||
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
|
||||||
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
|
||||||
|
|
||||||
# Format the `directories` file in the correct syntax and sent it to all three configs.
|
|
||||||
eval "echo \"$(cat "$bmdirs")\"" | \
|
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
|
||||||
printf(\"%s=\42cd %s && ls -a\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
|
||||||
printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
|
||||||
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ;
|
|
||||||
printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ;
|
|
||||||
printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" ;
|
|
||||||
printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }"
|
|
||||||
|
|
||||||
# Format the `files` file in the correct syntax and sent it to both configs.
|
|
||||||
eval "echo \"$(cat "$bmfiles")\"" | \
|
|
||||||
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
|
|
||||||
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
|
|
||||||
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
|
|
||||||
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
|
|
||||||
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
|
|
||||||
printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ;
|
|
||||||
printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }"
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Give a file with images and timecodes and creates a video slideshow of them.
|
|
||||||
#
|
|
||||||
# Timecodes must be in format 00:00:00.
|
|
||||||
#
|
|
||||||
# Imagemagick and ffmpeg required.
|
|
||||||
|
|
||||||
# Application cache if not stated elsewhere.
|
|
||||||
cache="${XDG_CACHE_HOME:-$HOME/.cache}/slider"
|
|
||||||
|
|
||||||
while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in
|
|
||||||
c) bgc="$OPTARG" ;;
|
|
||||||
t) fgc="$OPTARG" ;;
|
|
||||||
f) font="$OPTARG" ;;
|
|
||||||
i) file="$OPTARG" ;;
|
|
||||||
a) audio="$OPTARG" ;;
|
|
||||||
o) outfile="$OPTARG" ;;
|
|
||||||
d) prepdir="$OPTARG" ;;
|
|
||||||
r) redo="$OPTARG" ;;
|
|
||||||
s) ppt="$OPTARG" ;;
|
|
||||||
e) endtime="$OPTARG" ;;
|
|
||||||
x) res="$OPTARG"
|
|
||||||
echo "$res" | grep -qv "^[0-9]\+x[0-9]\+$" &&
|
|
||||||
echo "Resolution must be dimensions separated by a 'x': 1280x720, etc." &&
|
|
||||||
exit 1 ;;
|
|
||||||
p) echo "Purge old build files in $cache? [y/N]"
|
|
||||||
read -r confirm
|
|
||||||
echo "$confirm" | grep -iq "^y$" && rm -rf "$cache" && echo "Done."
|
|
||||||
exit ;;
|
|
||||||
v) verbose=True ;;
|
|
||||||
*) echo "$(basename "$0") usage:
|
|
||||||
-i input timecode list (required)
|
|
||||||
-a audio file
|
|
||||||
-c color of background (use html names, black is default)
|
|
||||||
-t text color for text slides (white is default)
|
|
||||||
-s text font size for text slides (150 is default)
|
|
||||||
-f text font for text slides (sans serif is default)
|
|
||||||
-o output video file
|
|
||||||
-e if no audio given, the time in seconds that the last slide will be shown (5 is default)
|
|
||||||
-x resolution (1920x1080 is default)
|
|
||||||
-d tmp directory
|
|
||||||
-r rerun imagemagick commands even if done previously (in case files or background has changed)
|
|
||||||
-p purge old build files instead of running
|
|
||||||
-v be verbose" && exit 1
|
|
||||||
|
|
||||||
esac done
|
|
||||||
|
|
||||||
# Check that the input file looks like it should.
|
|
||||||
{ head -n 1 "$file" 2>/dev/null | grep -q "^00:00:00 " ;} || {
|
|
||||||
echo "Give an input file with -i." &&
|
|
||||||
echo "The file should look as this example:
|
|
||||||
|
|
||||||
00:00:00 first_image.jpg
|
|
||||||
00:00:03 otherdirectory/next_image.jpg
|
|
||||||
00:00:09 this_image_starts_at_9_seconds.jpg
|
|
||||||
etc...
|
|
||||||
|
|
||||||
Timecodes and filenames must be separated by Tabs." &&
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "${audio+x}" ]; then
|
|
||||||
# Check that the audio file looks like an actual audio file.
|
|
||||||
case "$(file --dereference --brief --mime-type -- "$audio")" in
|
|
||||||
audio/*) ;;
|
|
||||||
*) echo "That doesn't look like an audio file."; exit 1 ;;
|
|
||||||
esac
|
|
||||||
totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))"
|
|
||||||
endtime="$((totseconds-seconds))"
|
|
||||||
fi
|
|
||||||
|
|
||||||
prepdir="${prepdir:-$cache/$file}"
|
|
||||||
outfile="${outfile:-$file.mp4}"
|
|
||||||
prepfile="$prepdir/$file.prep"
|
|
||||||
|
|
||||||
[ -n "${verbose+x}" ] && echo "Preparing images... May take a while depending on the number of files."
|
|
||||||
mkdir -p "$prepdir"
|
|
||||||
|
|
||||||
{
|
|
||||||
while read -r x;
|
|
||||||
do
|
|
||||||
# Get the time from the first column.
|
|
||||||
time="${x%% *}"
|
|
||||||
seconds="$(date '+%s' -d "$time")"
|
|
||||||
# Duration is not used on the first looped item.
|
|
||||||
duration="$((seconds - prevseconds))"
|
|
||||||
|
|
||||||
# Get the filename/text content from the rest.
|
|
||||||
content="${x#* }"
|
|
||||||
base="$(basename "$content")"
|
|
||||||
base="${base%.*}.jpg"
|
|
||||||
|
|
||||||
if [ -f "$content" ]; then
|
|
||||||
# If images have already been made in a previous run, do not recreate
|
|
||||||
# them unless -r was given.
|
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
|
||||||
convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base"
|
|
||||||
else
|
|
||||||
{ [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} &&
|
|
||||||
convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If the first line, do not write yet.
|
|
||||||
[ "$time" = "00:00:00" ] || echo "file '$prevbase'
|
|
||||||
duration $duration"
|
|
||||||
|
|
||||||
# Keep the information required for the next file.
|
|
||||||
prevbase="$base"
|
|
||||||
prevtime="$time"
|
|
||||||
prevseconds="$(date '+%s' -d "$prevtime")"
|
|
||||||
done < "$file"
|
|
||||||
# Do last file which must be given twice as follows
|
|
||||||
echo "file '$base'
|
|
||||||
duration ${endtime:-5}
|
|
||||||
file '$base'"
|
|
||||||
} > "$prepfile"
|
|
||||||
if [ -n "${audio+x}" ]; then
|
|
||||||
ffmpeg -hide_banner -y -f concat -safe 0 -i "$prepfile" -i "$audio" -c:a aac -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile"
|
|
||||||
else
|
|
||||||
ffmpeg -hide_banner -y -f concat -safe 0 -i "$prepfile" -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Might also try:
|
|
||||||
# -vf "fps=${fps:-24},format=yuv420p" "$outfile"
|
|
||||||
# but has given some problems.
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Prints all batteries, their percentage remaining and an emoji corresponding
|
|
||||||
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
3) notify-send "🔋 Battery module" "🔋: discharging
|
|
||||||
🛑: not charging
|
|
||||||
♻: stagnant charge
|
|
||||||
🔌: charging
|
|
||||||
⚡: charged
|
|
||||||
❗: battery very low!
|
|
||||||
- Scroll to change adjust xbacklight." ;;
|
|
||||||
4) xbacklight -inc 10 ;;
|
|
||||||
5) xbacklight -dec 10 ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Loop through all attached batteries and format the info
|
|
||||||
for battery in /sys/class/power_supply/BAT?*; do
|
|
||||||
# If non-first battery, print a space separator.
|
|
||||||
[ -n "${capacity+x}" ] && printf " "
|
|
||||||
# Sets up the status and capacity
|
|
||||||
case "$(cat "$battery/status" 2>&1)" in
|
|
||||||
"Full") status="⚡" ;;
|
|
||||||
"Discharging") status="🔋" ;;
|
|
||||||
"Charging") status="🔌" ;;
|
|
||||||
"Not charging") status="🛑" ;;
|
|
||||||
"Unknown") status="♻️" ;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
capacity="$(cat "$battery/capacity" 2>&1)"
|
|
||||||
# Will make a warn variable if discharging and low
|
|
||||||
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
|
||||||
# Prints the info
|
|
||||||
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
|
||||||
done && printf "\\n"
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
clock=$(date '+%I')
|
|
||||||
|
|
||||||
case "$clock" in
|
|
||||||
"00") icon="🕛" ;;
|
|
||||||
"01") icon="🕐" ;;
|
|
||||||
"02") icon="🕑" ;;
|
|
||||||
"03") icon="🕒" ;;
|
|
||||||
"04") icon="🕓" ;;
|
|
||||||
"05") icon="🕔" ;;
|
|
||||||
"06") icon="🕕" ;;
|
|
||||||
"07") icon="🕖" ;;
|
|
||||||
"08") icon="🕗" ;;
|
|
||||||
"09") icon="🕘" ;;
|
|
||||||
"10") icon="🕙" ;;
|
|
||||||
"11") icon="🕚" ;;
|
|
||||||
"12") icon="🕛" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
|
|
||||||
2) setsid -f "$TERMINAL" -e calcurse ;;
|
|
||||||
3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
|
|
||||||
- Middle click opens calcurse if installed" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
date "+%Y %b %d (%a) $icon%I:%M%p"
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
|
|
||||||
2) setsid -f "$TERMINAL" -e htop ;;
|
|
||||||
3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
|
|
||||||
- Click to show intensive processes.
|
|
||||||
- Middle click to open htop." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
sensors | awk '/Core 0/ {print "🌡" $3}'
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Module showing CPU load as a changing bars.
|
|
||||||
# Just like in polybar.
|
|
||||||
# Each bar represents amount of load on one core since
|
|
||||||
# last run.
|
|
||||||
|
|
||||||
# Cache in tmpfs to improve speed and reduce SSD load
|
|
||||||
cache=/tmp/cpubarscache
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
2) setsid -f "$TERMINAL" -e htop ;;
|
|
||||||
3) notify-send "🪨 CPU load module" "Each bar represents
|
|
||||||
one CPU core";;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# id total idle
|
|
||||||
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
|
|
||||||
[ ! -f $cache ] && echo "$stats" > "$cache"
|
|
||||||
old=$(cat "$cache")
|
|
||||||
printf "🪨"
|
|
||||||
echo "$stats" | while read -r row; do
|
|
||||||
id=${row%% *}
|
|
||||||
rest=${row#* }
|
|
||||||
total=${rest%% *}
|
|
||||||
idle=${rest##* }
|
|
||||||
|
|
||||||
case "$(echo "$old" | awk '{if ($1 == id)
|
|
||||||
printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
|
|
||||||
id="$id" total="$total" idle="$idle")" in
|
|
||||||
|
|
||||||
"0") printf "▁";;
|
|
||||||
"1") printf "▂";;
|
|
||||||
"2") printf "▃";;
|
|
||||||
"3") printf "▄";;
|
|
||||||
"4") printf "▅";;
|
|
||||||
"5") printf "▆";;
|
|
||||||
"6") printf "▇";;
|
|
||||||
"7") printf "█";;
|
|
||||||
"8") printf "█";;
|
|
||||||
esac
|
|
||||||
done; printf "\\n"
|
|
||||||
echo "$stats" > "$cache"
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Status bar module for disk space
|
|
||||||
# $1 should be drive mountpoint, otherwise assumed /.
|
|
||||||
|
|
||||||
location=${1:-/}
|
|
||||||
|
|
||||||
[ -d "$location" ] || exit
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
|
|
||||||
3) notify-send "💽 Disk module" "\- Shows used hard drive space.
|
|
||||||
- Click to show all disk info." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$location" in
|
|
||||||
"/home"* ) icon="🏠" ;;
|
|
||||||
"/mnt"* ) icon="💾" ;;
|
|
||||||
*) icon="🖥";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"
|
|
||||||
@ -1,206 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Show a Doppler RADAR of an American user's preferred location.
|
|
||||||
|
|
||||||
secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds.
|
|
||||||
radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar"
|
|
||||||
doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif"
|
|
||||||
|
|
||||||
pickloc() { chosen="$(echo "Northeast
|
|
||||||
Southeast
|
|
||||||
PacNorthWest
|
|
||||||
PacSouthWest
|
|
||||||
UpperMissVly
|
|
||||||
SouthMissVly
|
|
||||||
SouthPlains
|
|
||||||
NorthRockies
|
|
||||||
SouthRockies
|
|
||||||
Alaska
|
|
||||||
Carib
|
|
||||||
Hawaii
|
|
||||||
CentGrLakes
|
|
||||||
Conus-Large
|
|
||||||
KABR: Aberdeen, SD
|
|
||||||
KBIS: Bismarck, ND
|
|
||||||
KFTG: Denver/Boulder, CO
|
|
||||||
KDMX: Des Moines, IA
|
|
||||||
KDTX: Detroit, MI
|
|
||||||
KDDC: Dodge City, KS
|
|
||||||
KDLH: Duluth, MN
|
|
||||||
KCYS: Cheyenne, WY
|
|
||||||
KLOT: Chicago, IL
|
|
||||||
KGLD: Goodland, KS
|
|
||||||
KUEX: Hastings, NE
|
|
||||||
KGJX: Grand Junction, CO
|
|
||||||
KGRR: Grand Rapids, MI
|
|
||||||
KMVX: Fargo/Grand Forks, ND
|
|
||||||
KGRB: Green Bay, WI
|
|
||||||
KIND: Indianapolis, IN
|
|
||||||
KJKL: Jackson, KY
|
|
||||||
KARX: La Crosse, WI
|
|
||||||
KILX: Lincoln/Central Illinois, IL
|
|
||||||
KLVX: Louisville, KY
|
|
||||||
KMQT: Marquette
|
|
||||||
KMKX: Milwaukee, WI
|
|
||||||
KMPX: Minneapolis, MN
|
|
||||||
KAPX: Gaylord/Alpena, MI
|
|
||||||
KLNX: North Platte, NE
|
|
||||||
KIWX: N. Webster/Northern, IN
|
|
||||||
KOAX: Omaha, NE
|
|
||||||
KPAH: Paducah, KY
|
|
||||||
KEAX: Pleasant Hill, MO
|
|
||||||
KPUX: Pueblo, CO
|
|
||||||
KDVN: Quad Cities, IA
|
|
||||||
KUDX: Rapid City, SD
|
|
||||||
KRIW: Riverton, WY
|
|
||||||
KSGF: Springfield, MO
|
|
||||||
KLSX: St. LOUIS, MO
|
|
||||||
KFSD: Sioux Falls, IA
|
|
||||||
KTWX: Topeka, KS
|
|
||||||
KICT: Wichita, KS
|
|
||||||
KVWX: Paducah, KY
|
|
||||||
ICAO: Responsible Wfo
|
|
||||||
KLTX: WILMINGTON, NC
|
|
||||||
KCCX: State College/Central, PA
|
|
||||||
KLWX: Sterling, VA
|
|
||||||
KFCX: Blacksburg/Roanoke, VA
|
|
||||||
KRAX: Raleigh/Durham, NC
|
|
||||||
KGYX: Portland, ME
|
|
||||||
KDIX: Mt Holly/Philadelphia, PA
|
|
||||||
KPBZ: Pittsburgh, PA
|
|
||||||
KAKQ: Wakefield, VA
|
|
||||||
KMHX: Morehead City, NC
|
|
||||||
KGSP: Greer/Greenville/Sprtbg, SC
|
|
||||||
KILN: Wilmington/Cincinnati, OH
|
|
||||||
KCLE: Cleveland, OH
|
|
||||||
KCAE: Columbia, SC
|
|
||||||
KBGM: Binghamton, NY
|
|
||||||
KENX: Albany, NY
|
|
||||||
KBUF: Buffalo, NY
|
|
||||||
KCXX: Burlington, VT
|
|
||||||
KCBW: Caribou, ME
|
|
||||||
KBOX: Boston /Taunton, MA
|
|
||||||
KOKX: New York City, NY
|
|
||||||
KCLX: Charleston, SC
|
|
||||||
KRLX: Charleston, WV
|
|
||||||
ICAO: Responsible WFO
|
|
||||||
KBRO: Brownsville, TX
|
|
||||||
KABX: Albuquerque, NM
|
|
||||||
KAMA: Amarillo, TX
|
|
||||||
KFFC: Peachtree City/Atlanta, GA
|
|
||||||
KEWX: Austin/Sanantonio, TX
|
|
||||||
KBMX: Birmingham, AL
|
|
||||||
KCRP: Corpus Christi, TX
|
|
||||||
KFWS: Dallas / Ft. Worth, TX
|
|
||||||
KEPZ: El Paso, TX
|
|
||||||
KHGX: Houston/ Galveston, TX
|
|
||||||
KJAX: Jacksonville, FL
|
|
||||||
KBYX: Key West, FL
|
|
||||||
KMRX: Morristown/knoxville, TN
|
|
||||||
KLBB: Lubbock, TX
|
|
||||||
KLZK: Little Rock, AR
|
|
||||||
KLCH: Lake Charles, LA
|
|
||||||
KOHX: Nashville, TN
|
|
||||||
KMLB: Melbourne, FL
|
|
||||||
KNQA: Memphis, TN
|
|
||||||
KAMX: Miami, FL
|
|
||||||
KMAF: Midland/odessa, TX
|
|
||||||
KTLX: Norman, OK
|
|
||||||
KHTX: Huntsville, AL
|
|
||||||
KMOB: Mobile, AL
|
|
||||||
KTLH: Tallahassee, FL
|
|
||||||
KTBW: Tampa Bay Area, FL
|
|
||||||
KSJT: San Angelo, TX
|
|
||||||
KINX: Tulsa, OK
|
|
||||||
KSRX: Tulsa, OK
|
|
||||||
KLIX: New Orleans/slidell, LA
|
|
||||||
KDGX: Jackson, MS
|
|
||||||
KSHV: Shreveport, LA
|
|
||||||
ICAO: Responsible WFO
|
|
||||||
KLGX: Seattle / Tacoma, WA
|
|
||||||
KOTX: Spokane, WA
|
|
||||||
KEMX: Tucson, AZ
|
|
||||||
KYUX: Phoenix, AZ
|
|
||||||
KNKX: San Diego, CA
|
|
||||||
KMUX: Monterey/san Francisco, CA
|
|
||||||
KHNX: San Joaquin/hanford, CA
|
|
||||||
KSOX: San Diego, CA
|
|
||||||
KATX: Seattle / Tacoma, WA
|
|
||||||
KIWA: Phoenix, AZ
|
|
||||||
KRTX: Portland, OR
|
|
||||||
KSFX: Pocatello, ID
|
|
||||||
KRGX: Reno, NV
|
|
||||||
KDAX: Sacramento, CA
|
|
||||||
KMTX: Salt Lake City, UT
|
|
||||||
KPDT: Pendleton, OR
|
|
||||||
KMSX: Missoula, MT
|
|
||||||
KESX: Las Vegas, NV
|
|
||||||
KVTX: Los Angeles, CA
|
|
||||||
KMAX: Medford, OR
|
|
||||||
KFSX: Flagstaff, AZ
|
|
||||||
KGGW: Glasgow, MT
|
|
||||||
KLRX: Elko, NV
|
|
||||||
KBHX: Eureka, CA
|
|
||||||
KTFX: Great Falls, MT
|
|
||||||
KCBX: Boise, ID
|
|
||||||
KBLX: Billings, MT
|
|
||||||
KICX: Salt Lake City, UT
|
|
||||||
ICAO: Responsible Wfo W/ MSCF
|
|
||||||
PABC: Anchorage, AK
|
|
||||||
PAPD: Fairbanks, AK
|
|
||||||
PHKM: Honolulu, HI
|
|
||||||
PAHG: Anchorage, AK
|
|
||||||
PAKC: Anchorage, AK
|
|
||||||
PAIH: Anchorage, AK
|
|
||||||
PHMO: Honolulu, HI
|
|
||||||
PAEC: Fairbanks, AK
|
|
||||||
TJUA: San Juan, PR
|
|
||||||
PACG: Juneau, AK
|
|
||||||
PHKI: Honolulu, HI
|
|
||||||
PHWA: Honolulu, HI
|
|
||||||
ICAO: Responsible Wfo W/ MSCF
|
|
||||||
KFDR: Norman, OK
|
|
||||||
PGUA: Guam
|
|
||||||
KBBX: Sacramento, CA
|
|
||||||
KFDX: Albuquerque, NM
|
|
||||||
KGWX: Jackson, MS
|
|
||||||
KDOX: Wakefield, VA
|
|
||||||
KDYX: San Angelo, TX
|
|
||||||
KEYX: Las Vegas, NV
|
|
||||||
KEVX: Mobile, AL
|
|
||||||
KHPX: Paducah, KY
|
|
||||||
KTYX: Burlington, VT
|
|
||||||
KGRK: Dallas / Ft. Worth, TX
|
|
||||||
KPOE: Lake Charles, LA
|
|
||||||
KEOX: Tallahassee, FL
|
|
||||||
KHDX: El Paso, TX
|
|
||||||
KDFX: San Antonio, TX
|
|
||||||
KMXX: Birmingham, AL
|
|
||||||
KMBX: Bismarck, ND
|
|
||||||
KVAX: Jacksonville, FL
|
|
||||||
KJGX: Peachtree City/atlanta, GA
|
|
||||||
KVNX: Norman, OK
|
|
||||||
KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")"
|
|
||||||
|
|
||||||
# Sanity check of selection and ensure user did not escape.
|
|
||||||
echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;}
|
|
||||||
|
|
||||||
getdoppler() {
|
|
||||||
loc="$(cat "$radarloc")"
|
|
||||||
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
|
|
||||||
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;}
|
|
||||||
|
|
||||||
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) [ ! -f "$radarloc" ] && pickloc && getdoppler
|
|
||||||
[ $(($(date '+%s') - $(stat -c %Y "$doppler"))) -gt "$secs" ] && getdoppler
|
|
||||||
showdoppler ;;
|
|
||||||
2) pickloc && getdoppler && showdoppler ;;
|
|
||||||
3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
|
|
||||||
- Middle click to update change RADAR location.
|
|
||||||
After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo 🗺️
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Displays todays precipication chance (☔) and daily low (🥶) and high (🌞).
|
|
||||||
# Usually intended for the statusbar.
|
|
||||||
|
|
||||||
# If we have internet, get a weather report from wttr.in and store it locally.
|
|
||||||
# You could set up a shell alias to view the full file in a pager in the
|
|
||||||
# terminal if desired. This function will only be run once a day when needed.
|
|
||||||
weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"
|
|
||||||
getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
|
|
||||||
|
|
||||||
# Some very particular and terse stream manipulation. We get the maximum
|
|
||||||
# precipitation chance and the daily high and low from the downloaded file and
|
|
||||||
# display them with coresponding emojis.
|
|
||||||
showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
|
|
||||||
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
|
|
||||||
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
|
|
||||||
2) getforecast && showweather ;;
|
|
||||||
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
|
|
||||||
- Middle click to update forecast.
|
|
||||||
☔: Chance of rain/snow
|
|
||||||
🥶: Daily low
|
|
||||||
🌞: Daily high" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# The test if our forcecast is updated to the day. If it isn't download a new
|
|
||||||
# weather report from wttr.in with the above function.
|
|
||||||
[ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
|
||||||
getforecast
|
|
||||||
|
|
||||||
showweather
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# The clickable help menu. Middle click to restart wm.
|
|
||||||
|
|
||||||
# If dwm is running, use dwm's readme and restart.
|
|
||||||
pidof dwm >/dev/null &&
|
|
||||||
READMEFILE=/usr/local/share/dwm/larbs.mom
|
|
||||||
restartwm() { pkill -HUP dwm ;} ||
|
|
||||||
restartwm() { i3 restart ;}
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
|
|
||||||
2) restartwm ;;
|
|
||||||
3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
|
|
||||||
- Middle click to refresh window manager." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac; echo "❓"
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Show wifi 📶 and percent strength or 📡 if none.
|
|
||||||
# Show 🌐 if connected to ethernet or ❎ if none.
|
|
||||||
# Show 🔒 if a vpn connection is active
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
|
|
||||||
3) notify-send "🌐 Internet module" "\- Click to connect
|
|
||||||
❌: wifi disabled
|
|
||||||
📡: no wifi connection
|
|
||||||
📶: wifi connection with quality
|
|
||||||
❎: no ethernet
|
|
||||||
🌐: ethernet working
|
|
||||||
🔒: vpn is active
|
|
||||||
" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
|
|
||||||
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
|
||||||
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
|
|
||||||
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Gets your public ip address checks which country you are in and
|
|
||||||
# displays that information in the statusbar
|
|
||||||
#
|
|
||||||
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
|
||||||
|
|
||||||
ifinstalled "geoip" || exit
|
|
||||||
addr="$(curl ifconfig.me 2>/dev/null)" || exit
|
|
||||||
grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# works on any init system
|
|
||||||
# requirements: dmenu, xorg-setxkbmap
|
|
||||||
kb="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')" || exit 1
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) kb_choice="$(awk '/! layout/{flag=1; next} /! variant/{flag=0} flag {print $2, "- " $1}' /usr/share/X11/xkb/rules/base.lst | dmenu -l 15)"
|
|
||||||
kb="$(echo "$kb_choice" | awk '{print $3}')"
|
|
||||||
setxkbmap "$kb"
|
|
||||||
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";;
|
|
||||||
3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')")
|
|
||||||
- Left click to change keyboard.";;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "$kb"
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Displays number of unread mail and an loading icon if updating.
|
|
||||||
# When clicked, brings up `neomutt`.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e neomutt ;;
|
|
||||||
2) setsid -f mw -Y >/dev/null ;;
|
|
||||||
3) notify-send "📬 Mail module" "\- Shows unread mail
|
|
||||||
- Shows 🔃 if syncing mail
|
|
||||||
- Left click opens neomutt
|
|
||||||
- Middle click syncs mail" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
|
||||||
|
|
||||||
pidof mbsync >/dev/null 2>&1 && icon="🔃"
|
|
||||||
|
|
||||||
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon"
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
|
|
||||||
2) setsid -f "$TERMINAL" -e htop ;;
|
|
||||||
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
|
|
||||||
- Click to show memory hogs.
|
|
||||||
- Middle click to open htop." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Shows the current moon phase.
|
|
||||||
|
|
||||||
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
|
||||||
|
|
||||||
[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
|
||||||
{ curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
|
|
||||||
|
|
||||||
icon="$(cat "$moonfile")"
|
|
||||||
|
|
||||||
case "$icon" in
|
|
||||||
🌑) name="New" ;;
|
|
||||||
🌒) name="Waxing Crescent" ;;
|
|
||||||
🌓) name="First Quarter" ;;
|
|
||||||
🌔) name="Waxing Gibbous" ;;
|
|
||||||
🌕) name="Full" ;;
|
|
||||||
🌖) name="Waning Gibbous" ;;
|
|
||||||
🌗) name="Last Quarter" ;;
|
|
||||||
🌘) name="Waning Crescent" ;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "${icon-?}"
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
3) notify-send "🌜 Moon phase module" "Displays current moon phase.
|
|
||||||
- 🌑: New
|
|
||||||
- 🌒: Waxing Crescent
|
|
||||||
- 🌓: First Quarter
|
|
||||||
- 🌔: Waxing Gibbous
|
|
||||||
- 🌕: Full
|
|
||||||
- 🌖: Waning Gibbous
|
|
||||||
- 🌗: Last Quarter
|
|
||||||
- 🌘: Waning Crescent" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# This loop will update the mpd statusbar module whenever a command changes the
|
|
||||||
# music player's status. mpd must be running on X's start for this to work.
|
|
||||||
|
|
||||||
while : ; do
|
|
||||||
mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break
|
|
||||||
done
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
|
|
||||||
|
|
||||||
pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause
|
|
||||||
2) mpc toggle | filter ;; # right click, pause/unpause
|
|
||||||
3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
|
|
||||||
- ⏸ when paused.
|
|
||||||
- Left click opens ncmpcpp.
|
|
||||||
- Middle click pauses.
|
|
||||||
- Scroll changes track.";; # right click, pause/unpause
|
|
||||||
4) mpc prev | filter ;; # scroll up, previous
|
|
||||||
5) mpc next | filter ;; # scroll down, next
|
|
||||||
6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
*) mpc status | filter ;;
|
|
||||||
esac
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Module showing network traffic. Shows how much data has been received (RX) or
|
|
||||||
# transmitted (TX) since the previous time this script ran. So if run every
|
|
||||||
# second, gives network traffic per second.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e bmon ;;
|
|
||||||
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
|
|
||||||
🔺: Traffic transmitted" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
update() {
|
|
||||||
sum=0
|
|
||||||
for arg; do
|
|
||||||
read -r i < "$arg"
|
|
||||||
sum=$(( sum + i ))
|
|
||||||
done
|
|
||||||
cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/}
|
|
||||||
[ -f "$cache" ] && read -r old < "$cache" || old=0
|
|
||||||
printf %d\\n "$sum" > "$cache"
|
|
||||||
printf %d\\n $(( sum - old ))
|
|
||||||
}
|
|
||||||
|
|
||||||
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
|
|
||||||
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
|
|
||||||
|
|
||||||
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Displays number of unread news items and an loading icon if updating.
|
|
||||||
# When clicked, brings up `newsboat`.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid "$TERMINAL" -e newsboat ;;
|
|
||||||
2) setsid -f newsup >/dev/null exit ;;
|
|
||||||
3) notify-send "📰 News module" "\- Shows unread news items
|
|
||||||
- Shows 🔃 if updating with \`newsup\`
|
|
||||||
- Left click opens newsboat
|
|
||||||
- Middle click syncs RSS feeds
|
|
||||||
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "📰" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)"
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Displays number of upgradeable packages.
|
|
||||||
# For this to work, have a `pacman -Sy` command run in the background as a
|
|
||||||
# cronjob every so often as root. This script will then read those packages.
|
|
||||||
# When clicked, it will run an upgrade via pacman.
|
|
||||||
#
|
|
||||||
# Add the following text as a file in /usr/share/libalpm/hooks/statusbar.hook:
|
|
||||||
#
|
|
||||||
# [Trigger]
|
|
||||||
# Operation = Upgrade
|
|
||||||
# Type = Package
|
|
||||||
# Target = *
|
|
||||||
#
|
|
||||||
# [Action]
|
|
||||||
# Description = Updating statusbar...
|
|
||||||
# When = PostTransaction
|
|
||||||
# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e sb-popupgrade ;;
|
|
||||||
2) notify-send "$(/usr/bin/pacman -Qu)" ;;
|
|
||||||
3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
|
|
||||||
- Left click to upgrade packages
|
|
||||||
- Middle click to show upgradable packages" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
printf "Beginning upgrade.\\n"
|
|
||||||
|
|
||||||
yay -Syu
|
|
||||||
pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
|
|
||||||
|
|
||||||
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
|
|
||||||
read -r _
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Usage:
|
|
||||||
# price <url> <Name of currency> <icon> <Price to show in>
|
|
||||||
# price bat "Basic Attention Token" 🦁
|
|
||||||
# When the name of the currency is multi-word, put it in quotes.
|
|
||||||
|
|
||||||
[ -z "$3" ] && exit 1
|
|
||||||
|
|
||||||
# use $4 as currency, if not passed in use "usd" as default
|
|
||||||
currency="${4:-usd}"
|
|
||||||
interval="@14d" # History contained in chart preceded by '@' (7d = 7 days)
|
|
||||||
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
|
|
||||||
pricefile="$dir/$1-$currency"
|
|
||||||
chartfile="$dir/$1-$currency-chart"
|
|
||||||
|
|
||||||
updateprice() { temp="$(mktemp)"
|
|
||||||
curl -s "$currency.rate.sx/1$1" > "$temp" &&
|
|
||||||
mv -f "$temp" "$pricefile" &&
|
|
||||||
curl -s "$currency.rate.sx/$1$interval" > "$temp" &&
|
|
||||||
mv -f "$temp" "$chartfile" ;}
|
|
||||||
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
|
||||||
|
|
||||||
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
|
||||||
updateprice "$1"
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;;
|
|
||||||
2) notify-send -u low "$3 Updating..." "Updating $2 price..."
|
|
||||||
updateprice "$1" && notify-send "$3 Update complete." "$2 price is now
|
|
||||||
\$$(cat "$pricefile")" ;;
|
|
||||||
3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
|
|
||||||
notify-send "$3 $2 module" "\- <b>Exact price: \$$(cat "$pricefile")</b>
|
|
||||||
- Left click for chart of changes.
|
|
||||||
- Middle click to update.
|
|
||||||
- Shows 🔃 if updating prices.
|
|
||||||
- <b>Last updated:
|
|
||||||
$uptime</b>" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$currency" in
|
|
||||||
usd) symb="$" ;;
|
|
||||||
gbp) symb="£" ;;
|
|
||||||
eur) symb="€" ;;
|
|
||||||
btc) symb="₿" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
printf "$3$symb%0.2f$after" "$(cat "$pricefile")"
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Originally by Andr3as07 <https://github.com/Andr3as07>
|
|
||||||
# Some changes by Luke
|
|
||||||
# Rebuild by Tenyun
|
|
||||||
|
|
||||||
# This block displays the number running background tasks. Requires tsp.
|
|
||||||
|
|
||||||
num=$(tsp -l | awk -v numr=0 -v numq=0 '{if (/running/)numr++; if (/queued/)numq++} END{print numr+numq"("numq")"}')
|
|
||||||
|
|
||||||
# Handle mouse clicks
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e tsp -l ;;
|
|
||||||
3) notify-send "Tasks module" "🤖: number of running/queued background tasks
|
|
||||||
- Left click opens tsp" ;; # Right click
|
|
||||||
2) $EDITOR "$0" ;; # Middle click
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ "$num" != "0(0)" ] &&
|
|
||||||
echo "🤖$num"
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
transmission-remote -l | grep % |
|
|
||||||
sed " # The letters are for sorting and will not appear.
|
|
||||||
s/.*Stopped.*/A 🛑/;
|
|
||||||
s/.*Seeding.*/Z 🌱/;
|
|
||||||
s/.*100%.*/N ✅/;
|
|
||||||
s/.*Idle.*/B 🕰️/;
|
|
||||||
s/.*Uploading.*/L ⬆️/;
|
|
||||||
s/.*%.*/M ⬇️/" |
|
|
||||||
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e tremc ;;
|
|
||||||
2) td-toggle ;;
|
|
||||||
3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
|
|
||||||
- Middle click to toggle transmission.
|
|
||||||
- Shift click to edit script.
|
|
||||||
Module shows number of torrents:
|
|
||||||
🛑: paused
|
|
||||||
🕰: idle (seeds needed)
|
|
||||||
🔼: uploading (unfinished)
|
|
||||||
🔽: downloading
|
|
||||||
✅: done
|
|
||||||
🌱: done and seeding" ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Prints the current volume or 🔇 if muted.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1) setsid -f "$TERMINAL" -e pulsemixer ;;
|
|
||||||
2) pamixer -t ;;
|
|
||||||
4) pamixer --allow-boost -i 1 ;;
|
|
||||||
5) pamixer --allow-boost -d 1 ;;
|
|
||||||
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
|
||||||
- Middle click to mute.
|
|
||||||
- Scroll to change." ;;
|
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ $(pamixer --get-mute) = true ] && echo 🔇 && exit
|
|
||||||
|
|
||||||
vol="$(pamixer --get-volume)"
|
|
||||||
|
|
||||||
if [ "$vol" -gt "70" ]; then
|
|
||||||
icon="🔊"
|
|
||||||
elif [ "$vol" -gt "30" ]; then
|
|
||||||
icon="🔉"
|
|
||||||
elif [ "$vol" -gt "0" ]; then
|
|
||||||
icon="🔈"
|
|
||||||
else
|
|
||||||
echo 🔇 && exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$icon$vol%"
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# A dmenu wrapper script for system functions.
|
|
||||||
case "$(readlink -f /sbin/init)" in
|
|
||||||
*systemd*) ctl='systemctl' ;;
|
|
||||||
*) ctl='loginctl' ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n💤 sleep\n🔃 reboot\n🖥️shutdown\n📺 display off" | dmenu -i -p 'Action: ')" in
|
|
||||||
'🔒 lock') slock ;;
|
|
||||||
'🚪 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;;
|
|
||||||
'♻️ renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;;
|
|
||||||
'🐻 hibernate') slock $ctl hibernate ;;
|
|
||||||
'💤 sleep') slock $ctl suspend ;;
|
|
||||||
'🔃 reboot') $ctl reboot ;;
|
|
||||||
'🖥️shutdown') $ctl poweroff ;;
|
|
||||||
'📺 display off') xset dpms force off ;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
err() { echo "Usage:
|
|
||||||
tag [OPTIONS] file
|
|
||||||
Options:
|
|
||||||
-a: artist/author
|
|
||||||
-t: song/chapter title
|
|
||||||
-A: album/book title
|
|
||||||
-n: track/chapter number
|
|
||||||
-N: total number of tracks/chapters
|
|
||||||
-d: year of publication
|
|
||||||
-g: genre
|
|
||||||
-c: comment
|
|
||||||
You will be prompted for title, artist, album and track if not given." && exit 1 ;}
|
|
||||||
|
|
||||||
while getopts "a:t:A:n:N:d:g:c:f:" o; do case "${o}" in
|
|
||||||
a) artist="${OPTARG}" ;;
|
|
||||||
t) title="${OPTARG}" ;;
|
|
||||||
A) album="${OPTARG}" ;;
|
|
||||||
n) track="${OPTARG}" ;;
|
|
||||||
N) total="${OPTARG}" ;;
|
|
||||||
d) date="${OPTARG}" ;;
|
|
||||||
g) genre="${OPTARG}" ;;
|
|
||||||
c) comment="${OPTARG}" ;;
|
|
||||||
f) file="${OPTARG}" ;;
|
|
||||||
*) printf "Invalid option: -%s\\n" "$OPTARG" && err ;;
|
|
||||||
esac done
|
|
||||||
|
|
||||||
shift $((OPTIND - 1))
|
|
||||||
|
|
||||||
file="$1"
|
|
||||||
|
|
||||||
[ ! -f "$file" ] && echo "Provide file to tag." && err
|
|
||||||
|
|
||||||
[ -z "$title" ] && echo "Enter a title." && read -r title
|
|
||||||
[ -z "$artist" ] && echo "Enter an artist." && read -r artist
|
|
||||||
[ -z "$album" ] && echo "Enter an album." && read -r album
|
|
||||||
[ -z "$track" ] && echo "Enter a track number." && read -r track
|
|
||||||
|
|
||||||
case "$file" in
|
|
||||||
*.ogg) echo "Title=$title
|
|
||||||
Artist=$artist
|
|
||||||
Album=$album
|
|
||||||
Track=$track
|
|
||||||
Total=$total
|
|
||||||
Date=$date
|
|
||||||
Genre=$genre
|
|
||||||
Comment=$comment" | vorbiscomment -w "$file" ;;
|
|
||||||
*.opus) echo "Title=$title
|
|
||||||
Artist=$artist
|
|
||||||
Album=$album
|
|
||||||
Track=$track
|
|
||||||
Total=$total
|
|
||||||
Date=$date
|
|
||||||
Genre=$genre
|
|
||||||
Comment=$comment" | opustags -i -S "$file" ;;
|
|
||||||
*.mp3) eyeD3 -Q --remove-all -a "$artist" -A "$album" -t "$title" -n "$track" -N "$total" -Y "$date" "$file" ;;
|
|
||||||
*.flac) echo "TITLE=$title
|
|
||||||
ARTIST=$artist
|
|
||||||
ALBUM=$album
|
|
||||||
TRACKNUMBER=$track
|
|
||||||
TOTALTRACKS=$total
|
|
||||||
DATE=$date
|
|
||||||
GENRE=$genre
|
|
||||||
DESCRIPTION=$comment" | metaflac --remove-all-tags --import-tags-from=- "$file" ;;
|
|
||||||
*) echo "File type not implemented yet." ;;
|
|
||||||
esac
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# If transmission-daemon is running, will ask to kill, else will ask to start.
|
|
||||||
|
|
||||||
if pidof transmission-daemon >/dev/null ;
|
|
||||||
then
|
|
||||||
[ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon disabled."
|
|
||||||
else
|
|
||||||
ifinstalled transmission-cli || exit
|
|
||||||
[ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "transmission-daemon enabled."
|
|
||||||
fi
|
|
||||||
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Clears the build files of a LaTeX/XeLaTeX build.
|
|
||||||
# I have vim run this file whenever I exit a .tex file.
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
*.tex)
|
|
||||||
file=$(readlink -f "$1")
|
|
||||||
dir=$(dirname "$file")
|
|
||||||
base="${file%.*}"
|
|
||||||
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete
|
|
||||||
rm -rdf "$dir/_minted-$(basename -- $base)"
|
|
||||||
;;
|
|
||||||
*) printf "Give .tex file as argument.\\n" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
ifinstalled tremc transmission-cli || exit
|
|
||||||
|
|
||||||
! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..."
|
|
||||||
|
|
||||||
$TERMINAL -e tremc; pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=File Manager
|
|
||||||
Exec=/usr/local/bin/st -e lf %u
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Image viewer
|
|
||||||
Exec=/usr/bin/sxiv -a %f
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Mail
|
|
||||||
Exec=/usr/local/bin/st -e neomutt %u
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=PDF reader
|
|
||||||
Exec=/usr/bin/zathura %u
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=RSS feed addition
|
|
||||||
Exec=/usr/bin/env rssadd %U
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Text editor
|
|
||||||
Exec=/usr/local/bin/st -e nvim %u
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Name=Torrent
|
|
||||||
Exec=/usr/bin/env transadd %U
|
|
||||||
@ -1 +0,0 @@
|
|||||||
thiemeyer_road_to_samarkand.jpg
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,10 +0,0 @@
|
|||||||
_
|
|
||||||
___ __ _| | ___ _ _ _ __ ___ ___
|
|
||||||
/ __/ _` | |/ __| | | | '__/ __|/ _ \
|
|
||||||
| (_| (_| | | (__| |_| | | \__ \ __/
|
|
||||||
\___\__,_|_|\___|\__,_|_| |___/\___|
|
|
||||||
|
|
||||||
calcurse is the calendar and schedule manager.
|
|
||||||
tab - Switch from calendar to todo to appointments
|
|
||||||
h/j/k/l - Move left/down/up/right
|
|
||||||
Most other bindings are listed in the program.
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
_ _
|
|
||||||
_ __ ___ _ _| |_| |_
|
|
||||||
| '_ ` _ \| | | | __| __|
|
|
||||||
| | | | | | |_| | |_| |_
|
|
||||||
|_| |_| |_|\__,_|\__|\__|
|
|
||||||
|
|
||||||
mutt is the email client.
|
|
||||||
j/k - Move down/up
|
|
||||||
d/u - Move down/up half page
|
|
||||||
gg - Move to top
|
|
||||||
v - View/download attachments
|
|
||||||
G - Move to last message
|
|
||||||
r - Reply
|
|
||||||
R - Reply all
|
|
||||||
S - Sync/save mailbox changes
|
|
||||||
D - Mark message for deletion
|
|
||||||
U - Unmark message for deletion
|
|
||||||
ctrl-u - Seek urls
|
|
||||||
,, - Seek urls
|
|
||||||
ctrl-f - Search mail indexed with notmuch
|
|
||||||
ctrl-r - Mark all as read
|
|
||||||
l - Limit mail
|
|
||||||
o - Run quick sync with offlineimap
|
|
||||||
O - Run full sync with offlineimap
|
|
||||||
C - Copy a message to another mailbox
|
|
||||||
M - Move a message to another mailbox
|
|
||||||
B - Hide/reveal sidebar
|
|
||||||
ctrl-j/k - Move down/up on sidebar
|
|
||||||
ctrl-o - Open box selected in sidebar
|
|
||||||
gi - Go to inbox
|
|
||||||
gs - Go to sent mail
|
|
||||||
gd - Go to drafts
|
|
||||||
gS - Go to spam
|
|
||||||
i# - Go to a different account (# is the number of the account)
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
_ __ ___ _ __ ___ _ __ ___ _ __ _ __
|
|
||||||
| '_ \ / __| '_ ` _ \| '_ \ / __| '_ \| '_ \
|
|
||||||
| | | | (__| | | | | | |_) | (__| |_) | |_) |
|
|
||||||
|_| |_|\___|_| |_| |_| .__/ \___| .__/| .__/
|
|
||||||
|_| |_| |_|
|
|
||||||
|
|
||||||
ncmpcpp is the music player.
|
|
||||||
h/j/k/l - Move left/down/up/right
|
|
||||||
d/u - Down/up page
|
|
||||||
a - Add song(s) to playlist
|
|
||||||
c - Clear playlist
|
|
||||||
g - Go to top
|
|
||||||
G - Go to bottom
|
|
||||||
p - Pause
|
|
||||||
m - Media library
|
|
||||||
f - Music sorted by directory structure
|
|
||||||
t - Tag editor
|
|
||||||
s - Search
|
|
||||||
v - Visualizer
|
|
||||||
P - Playlist
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
_ _
|
|
||||||
_ __ _____ _____| |__ ___ __ _| |_
|
|
||||||
| '_ \ / _ \ \ /\ / / __| '_ \ / _ \ / _` | __|
|
|
||||||
| | | | __/\ V V /\__ \ |_) | (_) | (_| | |_
|
|
||||||
|_| |_|\___| \_/\_/ |___/_.__/ \___/ \__,_|\__|
|
|
||||||
|
|
||||||
newsboat is the RSS reader.
|
|
||||||
j/k - Move down/up
|
|
||||||
l - Open entry
|
|
||||||
h/q - Back/quit
|
|
||||||
Q - Quit immediately
|
|
||||||
J/K - Previous/next feed
|
|
||||||
n - Next unread
|
|
||||||
N - Previous unread
|
|
||||||
a - Toggle article read/unread
|
|
||||||
A - Mark all as read
|
|
||||||
U - Show all URLs
|
|
||||||
,, - Open main link with linkhandler
|
|
||||||
,p - Pick which program to open link with
|
|
||||||
,v - Open video link in mpv
|
|
||||||
,w - Open link in w3m
|
|
||||||
,c - Copy link to clipboard
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
_ __ __ _ _ __ __ _ ___ _ __
|
|
||||||
| '__/ _` | '_ \ / _` |/ _ \ '__|
|
|
||||||
| | | (_| | | | | (_| | __/ |
|
|
||||||
|_| \__,_|_| |_|\__, |\___|_|
|
|
||||||
|___/
|
|
||||||
|
|
||||||
ranger is the file manager.
|
|
||||||
j/k - Down/up
|
|
||||||
h - Left/higher in directory structure
|
|
||||||
l - Right/open/lower in directory structure
|
|
||||||
gg - Go to top
|
|
||||||
G - Go to bottom
|
|
||||||
cw - Rename file
|
|
||||||
I - Rename file, with cursor at beginning
|
|
||||||
A - Rename file, with cursor at end
|
|
||||||
aa - Rename file, with cursor right before extension
|
|
||||||
mkd - Make directory
|
|
||||||
bg - Change background/wallpaper to selected file
|
|
||||||
X - Extract archive
|
|
||||||
Z - Compress into tar.gz
|
|
||||||
Space - Highlight/select file
|
|
||||||
va - Highlight/(de)select all
|
|
||||||
vs - Toggle visual selection mode
|
|
||||||
uv - Deselect all
|
|
||||||
dd - Cut file(s)
|
|
||||||
yy - Yank/copy file(s)
|
|
||||||
pp - Paste cut/copied file(s)
|
|
||||||
po - Paste cut/copied file(s), overwriting originals
|
|
||||||
cW - Rename all selected files in text editor
|
|
||||||
D - Delete file(s) (press enter to confirm)
|
|
||||||
dD - Delete file(s) (press enter to confirm)
|
|
||||||
ctrl-f - Fuzzy find (fzf)
|
|
||||||
ctrl-l - Search via mlocate
|
|
||||||
q - Quit
|
|
||||||
Q - Immediate quit
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
_
|
|
||||||
_____ _(_)_ __
|
|
||||||
/ __\ \/ / \ \ / /
|
|
||||||
\__ \> <| |\ V /
|
|
||||||
|___/_/\_\_| \_/
|
|
||||||
sxiv is the image viewer.
|
|
||||||
h/j/k/l - Pan image
|
|
||||||
-/+ - Zoom out/in
|
|
||||||
Enter - Toggle thumbnail mode
|
|
||||||
f - Fullscreen
|
|
||||||
n/p - Previous/next image in list/directory
|
|
||||||
r - Reload image if changed
|
|
||||||
m - Mark/unmark image
|
|
||||||
w - Zoom to fit window
|
|
||||||
ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options)
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
_ _
|
|
||||||
______ _| |_| |__ _ _ _ __ __ _
|
|
||||||
|_ / _` | __| '_ \| | | | '__/ _` |
|
|
||||||
/ / (_| | |_| | | | |_| | | | (_| |
|
|
||||||
/___\__,_|\__|_| |_|\__,_|_| \__,_|
|
|
||||||
|
|
||||||
zathura is the pdf/djvu reader.
|
|
||||||
h/j/k/l - Move left/down/up/right in document
|
|
||||||
d/u - Down/up a half page
|
|
||||||
gg - Top of document
|
|
||||||
G - Bottom of document
|
|
||||||
f - Highlight URLS to follow
|
|
||||||
J/K - Zoom out/in
|
|
||||||
s - Zoom to fit width
|
|
||||||
a - Zoom to fit height
|
|
||||||
r - Reload document if changed
|
|
||||||
R - Rotate document
|
|
||||||
D - Toggle dual-page mode
|
|
||||||
p - Print document
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
keycode 1 = Caps_Lock
|
|
||||||
keycode 58 = Escape
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 394 KiB |
Loading…
x
Reference in New Issue
Block a user