mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
af2c2b6a89
@ -7,5 +7,5 @@ h ${XDG_CONFIG_HOME:-$HOME}
|
|||||||
m ${XDG_MUSIC_DIR:-$HOME/Music}
|
m ${XDG_MUSIC_DIR:-$HOME/Music}
|
||||||
mn /mnt
|
mn /mnt
|
||||||
pp ${XDG_PICTURES_DIR:-$HOME/Pictures}
|
pp ${XDG_PICTURES_DIR:-$HOME/Pictures}
|
||||||
sc ${XDG_CONFIG_HOME:-$HOME/.local/bin}
|
sc ~/.local/bin
|
||||||
vv ${XDG_VIDEOS_DIR:-$HOME/Videos}
|
vv ${XDG_VIDEOS_DIR:-$HOME/Videos}
|
||||||
@ -14,3 +14,4 @@ cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config
|
|||||||
cfk ${XDG_CONFIG_HOME:-$HOME/.config}/sxhkd/sxhkdrc
|
cfk ${XDG_CONFIG_HOME:-$HOME/.config}/sxhkd/sxhkdrc
|
||||||
cfi ${XDG_CONFIG_HOME:-$HOME/.config}/i3/config
|
cfi ${XDG_CONFIG_HOME:-$HOME/.config}/i3/config
|
||||||
cfb ${XDG_CONFIG_HOME:-$HOME/.config}/i3blocks/config
|
cfb ${XDG_CONFIG_HOME:-$HOME/.config}/i3blocks/config
|
||||||
|
cff ${XDG_CONFIG_HOME:-$HOME/.config}/fontconfig/fonts.conf
|
||||||
|
|||||||
@ -103,7 +103,7 @@ set clipboard+=unnamedplus
|
|||||||
" Save file as sudo on files that require root permission
|
" Save file as sudo on files that require root permission
|
||||||
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
||||||
|
|
||||||
" Enable Goyo by default for mutt writting
|
" Enable Goyo by default for mutt writing
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
|
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light
|
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light
|
||||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
|
||||||
|
|||||||
@ -32,9 +32,9 @@ case "$ext" in
|
|||||||
go) go run "$file" ;;
|
go) go run "$file" ;;
|
||||||
h) sudo make install ;;
|
h) sudo make install ;;
|
||||||
m) octave "$file" ;;
|
m) octave "$file" ;;
|
||||||
md) if command -v lowdown >/dev/null; then
|
md) if [ -x "$(command -v lowdown)" ]; then
|
||||||
lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
|
lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
|
||||||
elif command -v groffdown >/dev/null; then
|
elif [ -x "$(command -v groffdown)" ]; then
|
||||||
groffdown -i "$file" | groff > "$base.pdf"
|
groffdown -i "$file" | groff > "$base.pdf"
|
||||||
else
|
else
|
||||||
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf
|
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Syncs repositories and downloads updates, meant to be run as a cronjob.
|
# Syncs repositories and downloads updates, meant to be run as a cronjob.
|
||||||
|
|
||||||
ping -q -c 1 1.1.1.1 > /dev/null || exit
|
ping -q -c example.org > /dev/null || exit
|
||||||
|
|
||||||
notify-send "📦 Repository Sync" "Checking for package updates..."
|
notify-send "📦 Repository Sync" "Checking for package updates..."
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# Set as a cron job to check for new RSS entries for newsboat.
|
# Set as a cron job to check for new RSS entries for newsboat.
|
||||||
# If newsboat is open, sends it an "R" key to refresh.
|
# If newsboat is open, sends it an "R" key to refresh.
|
||||||
|
|
||||||
ping -q -c 1 1.1.1.1 > /dev/null || exit
|
ping -q -c 1 example.org > /dev/null || exit
|
||||||
|
|
||||||
/usr/bin/notify-send "📰 Updating RSS feeds..."
|
/usr/bin/notify-send "📰 Updating RSS feeds..."
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ asktype() { \
|
|||||||
}
|
}
|
||||||
|
|
||||||
anddrives=$(simple-mtpfs -l 2>/dev/null)
|
anddrives=$(simple-mtpfs -l 2>/dev/null)
|
||||||
usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$4==""{printf "%s (%s)\n",$1,$3}')"
|
usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | grep 'part\|rom' | awk '$4==""{printf "%s (%s)\n",$1,$3}')"
|
||||||
|
|
||||||
if [ -z "$usbdrives" ]; then
|
if [ -z "$usbdrives" ]; then
|
||||||
[ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit
|
[ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit
|
||||||
|
|||||||
@ -17,6 +17,6 @@ case "$1" in
|
|||||||
*mp3|*flac|*opus|*mp3?source*)
|
*mp3|*flac|*opus|*mp3?source*)
|
||||||
setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
||||||
*)
|
*)
|
||||||
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1"
|
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR" "$1"
|
||||||
else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;;
|
else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
# usually the pdf of a compiled document. I find this useful especially
|
# usually the pdf of a compiled document. I find this useful especially
|
||||||
# running from vim.
|
# running from vim.
|
||||||
|
|
||||||
basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
|
basename="$(echo "${*}" | sed 's/\.[^\/.]*$//')"
|
||||||
|
|
||||||
case "$1" in
|
case "${*}" in
|
||||||
*.tex|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;;
|
*.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 ;;
|
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
|
||||||
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
|
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ esac
|
|||||||
for battery in /sys/class/power_supply/BAT?
|
for battery in /sys/class/power_supply/BAT?
|
||||||
do
|
do
|
||||||
# Get its remaining capacity and charge status.
|
# Get its remaining capacity and charge status.
|
||||||
capacity=$(cat "$battery"/capacity) || break
|
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
|
||||||
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
|
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
|
||||||
|
|
||||||
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
||||||
|
|||||||
@ -20,7 +20,7 @@ esac
|
|||||||
|
|
||||||
case $BLOCK_BUTTON in
|
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 -D ~/.config/calcurse -d3)" ;;
|
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;;
|
||||||
2) setsid -f "$TERMINAL" -e calcurse -D ~/.config/calcurse ;;
|
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\`
|
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" ;;
|
- Middle click opens calcurse if installed" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
|
|||||||
44
.local/bin/statusbar/cpubars
Executable file
44
.local/bin/statusbar/cpubars
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/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"
|
||||||
@ -36,7 +36,7 @@ printprices() { # Print/format all prices
|
|||||||
|
|
||||||
# If currencies haven't been updated today, try to update them.
|
# If currencies haven't been updated today, try to update them.
|
||||||
[ "$(stat -c %x "$HOME/.local/share/crypto-prices" | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
[ "$(stat -c %x "$HOME/.local/share/crypto-prices" | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
||||||
{ ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && getprices || exit ;}
|
{ ping -q -c 1 example.org >/dev/null 2>&1 && getprices || exit ;}
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
|
1) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# The clickable help menu. Middle click to restart wm.
|
# The clickable help menu. Middle click to restart wm.
|
||||||
|
|
||||||
# If dwm is running, use dwm's readme and restart.
|
# If dwm is running, use dwm's readme and restart.
|
||||||
pgrep -f "\sdwm$" &&
|
pidof dwm >/dev/null &&
|
||||||
READMEFILE=/usr/local/share/dwm/larbs.mom
|
READMEFILE=/usr/local/share/dwm/larbs.mom
|
||||||
restartwm() { pkill -HUP dwm ;} ||
|
restartwm() { pkill -HUP dwm ;} ||
|
||||||
restartwm() { i3 restart ;}
|
restartwm() { i3 restart ;}
|
||||||
|
|||||||
@ -19,10 +19,10 @@ update() {
|
|||||||
cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/}
|
cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/}
|
||||||
[ -f "$cache" ] && read -r old < "$cache" || old=0
|
[ -f "$cache" ] && read -r old < "$cache" || old=0
|
||||||
printf %d\\n "$sum" > "$cache"
|
printf %d\\n "$sum" > "$cache"
|
||||||
printf %d\\n $(( (sum - old) / 1024 ))
|
printf %d\\n $(( sum - old ))
|
||||||
}
|
}
|
||||||
|
|
||||||
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
|
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
|
||||||
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
|
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
|
||||||
|
|
||||||
printf "🔻%dKiB 🔺%dKiB\\n" "$rx" "$tx"
|
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)
|
||||||
|
|||||||
@ -11,18 +11,18 @@ dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
|
|||||||
pricefile="$dir/$1"
|
pricefile="$dir/$1"
|
||||||
chartfile="$dir/$1-chart"
|
chartfile="$dir/$1-chart"
|
||||||
|
|
||||||
updateprice() { ping -q -c 1 1.1.1.1 >/dev/null 2>&1 &&
|
updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 &&
|
||||||
curl -s "rate.sx/1$1" > "$pricefile" &&
|
curl -s "rate.sx/1$1" > "$pricefile" &&
|
||||||
curl -s "rate.sx/$1$interval" > "$chartfile" ;}
|
curl -s "rate.sx/$1$interval" > "$chartfile" ;}
|
||||||
|
|
||||||
[ -d "$dir" ] || mkdir -p "$dir"
|
[ -d "$dir" ] || mkdir -p "$dir"
|
||||||
|
|
||||||
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
|
||||||
updateprice
|
updateprice "$1"
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;;
|
1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;;
|
||||||
2) notify-send -u low "$3 Updating..." "Updating $2 price..." &&
|
2) notify-send -u low "$3 Updating..." "Updating $2 price..."
|
||||||
updateprice "$1" && notify-send "$3 Update complete." "$2 price is now
|
updateprice "$1" && notify-send "$3 Update complete." "$2 price is now
|
||||||
\$$(cat "$pricefile")" ;;
|
\$$(cat "$pricefile")" ;;
|
||||||
3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
|
3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
|
||||||
|
|||||||
10
.zprofile
10
.zprofile
@ -68,11 +68,15 @@ ex=🎯:\
|
|||||||
*.me=✍:\
|
*.me=✍:\
|
||||||
*.ms=✍:\
|
*.ms=✍:\
|
||||||
*.png=🖼:\
|
*.png=🖼:\
|
||||||
|
*.webp=🖼:\
|
||||||
*.ico=🖼:\
|
*.ico=🖼:\
|
||||||
*.jpg=📸:\
|
*.jpg=📸:\
|
||||||
|
*.jpe=📸:\
|
||||||
*.jpeg=📸:\
|
*.jpeg=📸:\
|
||||||
*.gif=🖼:\
|
*.gif=🖼:\
|
||||||
*.svg=🗺:\
|
*.svg=🗺:\
|
||||||
|
*.tif=🖼:\
|
||||||
|
*.tiff=🖼:\
|
||||||
*.xcf=🖌:\
|
*.xcf=🖌:\
|
||||||
*.html=🌎:\
|
*.html=🌎:\
|
||||||
*.xml=📰:\
|
*.xml=📰:\
|
||||||
@ -89,6 +93,7 @@ ex=🎯:\
|
|||||||
*.R=📊:\
|
*.R=📊:\
|
||||||
*.rmd=📊:\
|
*.rmd=📊:\
|
||||||
*.Rmd=📊:\
|
*.Rmd=📊:\
|
||||||
|
*.m=📊:\
|
||||||
*.mp3=🎵:\
|
*.mp3=🎵:\
|
||||||
*.opus=🎵:\
|
*.opus=🎵:\
|
||||||
*.ogg=🎵:\
|
*.ogg=🎵:\
|
||||||
@ -106,6 +111,9 @@ ex=🎯:\
|
|||||||
*.z64=🎮:\
|
*.z64=🎮:\
|
||||||
*.v64=🎮:\
|
*.v64=🎮:\
|
||||||
*.n64=🎮:\
|
*.n64=🎮:\
|
||||||
|
*.gba=🎮:\
|
||||||
|
*.nes=🎮:\
|
||||||
|
*.gdi=🎮:\
|
||||||
*.1=ℹ:\
|
*.1=ℹ:\
|
||||||
*.nfo=ℹ:\
|
*.nfo=ℹ:\
|
||||||
*.info=ℹ:\
|
*.info=ℹ:\
|
||||||
@ -116,6 +124,8 @@ ex=🎯:\
|
|||||||
*.ged=👪:\
|
*.ged=👪:\
|
||||||
*.part=💔:\
|
*.part=💔:\
|
||||||
*.torrent=🔽:\
|
*.torrent=🔽:\
|
||||||
|
*.jar=♨:\
|
||||||
|
*.java=♨:\
|
||||||
"
|
"
|
||||||
|
|
||||||
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
|
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user