This commit is contained in:
altffour 2020-12-26 16:31:17 +03:00
parent fc92526886
commit 5e3464ffcc
No known key found for this signature in database
GPG Key ID: B4ADFA86EDF5CCE9
32 changed files with 54 additions and 695 deletions

View File

@ -96,7 +96,7 @@ font:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: Anonymice Nerd Font
family: Terminus
# The `style` can be specified to pick a specific face.
style: Regular
@ -107,7 +107,7 @@ font:
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: Anonymice Nerd Font
family: Terminus
# The `style` can be specified to pick a specific face.
style: Bold
@ -118,7 +118,7 @@ font:
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Anonymice Nerd Font
family: Terminus
# The `style` can be specified to pick a specific face.
style: Italic
@ -129,7 +129,7 @@ font:
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Anonymice Nerd Font
family: Terminus
# The `style` can be specified to pick a specific face.
style: Bold Italic
@ -310,7 +310,7 @@ colors:
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
background_opacity: 0.85
background_opacity: 1.00
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"

View File

@ -9,8 +9,8 @@
#
# (An example:)
binlist=(
'~/.config/cdm/dwm-cdm' # Launch dwm,
'~/.config/cdm/xmonad-cdm' # Launch xmonad desktop,
'~/.config/cdm/dwm-cdm' # Launch dwm,
'~/.config/cdm/lxde-cdm' # Launch lxde desktop,
'/bin/bash --login' # Execute your Shell,
'reboot' # Reboot
'shutdown 0' # Shutdown
@ -20,7 +20,7 @@ binlist=(
# Names with whitespaces should be quoted or escaped.
#
# (Continued example:)
namelist=('dwm' 'xmonad' 'Console' 'Reboot' 'Shutdown')
namelist=('dwm' 'LXDE' 'Console' 'Reboot' 'Shutdown')
# Type of the programs, one-by-one matched with $binlist.
# `C' for *C*onsole programs, which would be `exec'ed.

View File

@ -1,10 +1,14 @@
exec feh --no-fehbg --bg-fill ~/proj/sysconf/wallpapers/wallpaper &
exec rm -r ~/.cache/wal &
exec wal -i ~/proj/sysconf/wallpapers/wallpaper &
#exec statusbar &
exec dwmblocks &
exec slstatus &
exec picom --config ~/.config/picom.conf &
exec xrandr --auto --output HDMI1 --mode 1024x768 --right-of eDP1 &
exec flameshot &
exec greenclip daemon &
#exec flameshot &
#exec greenclip daemon &
exec /usr/lib/kdeconnectd &
exec dunst &
exec dwm
#exec dunst &
exec xmodmap ~/.config/Xmodmap &
exec xrdb -merge ~/.cache/wal/colors.Xresources &
exec dbus-launch dwm

2
.config/cdm/lxde-cdm Executable file
View File

@ -0,0 +1,2 @@
cp ~/.config/cdm/lxde-xinit ~/.config/X11/xinitrc
startx ~/.config/X11/xinitrc

9
.config/cdm/lxde-xinit Normal file
View File

@ -0,0 +1,9 @@
#exec picom --config ~/.config/picom.conf &
#exec xrandr --auto --output HDMI1 --mode 1024x768 --right-of eDP1 &
#exec flameshot &
#exec greenclip daemon &
exec /usr/lib/kdeconnectd &
#exec dunst &
exec xmodmap ~/.config/Xmodmap &
#exec xrdb -merge ~/.cache/wal/colors.Xresources &
exec startlxde

View File

@ -10,6 +10,10 @@ export EDITOR="nvim"
export TERMINAL="alacritty"
export BROWSER="firefox"
export PATH="$HOME/.local/bin/statusbar/:$PATH"
export GPG_TTY=$(tty)
# ~/ clean-up
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"

View File

@ -1,39 +1,3 @@
#################################
# Animations #
#################################
# requires https://github.com/jonaburg/picom
# (These are also the default values)
transition-length = 75
transition-pow-x = 0.1
transition-pow-y = 0.1
transition-pow-w = 0.1
transition-pow-h = 0.1
size-transition = true
#################################
# Corners #
#################################
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
corner-radius = 10.0;
rounded-corners-exclude = [
#"window_type = 'normal'",
"class_g = 'awesome'",
"class_g = 'URxvt'",
"class_g = 'XTerm'",
"class_g = 'kitty'",
#"class_g = 'Alacritty'",
"class_g = 'Polybar'",
"class_g = 'code-oss'",
#"class_g = 'TelegramDesktop'",
#"class_g = 'firefox'",
"class_g = 'Thunderbird'"
];
round-borders = 1;
round-borders-exclude = [
#"class_g = 'TelegramDesktop'",
];
#################################
# Shadows #
#################################
@ -102,8 +66,6 @@ shadow-exclude = [
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"class_g = 'slop'",
"class_g = 'Polybar'",
"_GTK_FRAME_EXTENTS@:c"
];
@ -126,7 +88,7 @@ shadow-exclude = [
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
# fading = false
fading = false;
fading = false
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
@ -140,10 +102,7 @@ fade-out-step = 0.03;
# fade-delta = 10
# Specify a list of conditions of windows that should not be faded.
# don't need this, we disable fading for all normal windows with wintypes: {}
fade-exclude = [
"class_g = 'slop'" # maim
]
# fade-exclude = []
# Do not fade on window open/close.
# no-fading-openclose = false
@ -158,39 +117,29 @@ fade-exclude = [
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.8;
inactive-opacity = 1
#inactive-opacity = 0.8;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
frame-opacity = 0.7;
# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
# menu-opacity = 1.0
# menu-opacity is depreciated use dropdown-menu and popup-menu instead.
#If using these 2 below change their values in line 510 & 511 aswell
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
# menu-opacity = 1.0
# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
active-opacity = 1.0;
# active-opacity = 1.0
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'Bar'", # lemonbar
"class_g = 'slop'" # maim
];
focus-exclude = [ "class_g = 'Cairo-clock'" ];
# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0
@ -203,21 +152,6 @@ focus-exclude = [
# opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
opacity-rule = [
"80:class_g = 'Bar'", # lemonbar
"100:class_g = 'slop'", # maim
"100:class_g = 'XTerm'",
"100:class_g = 'URxvt'",
"100:class_g = 'kitty'",
"100:class_g = 'Alacritty'",
"80:class_g = 'Polybar'",
"100:class_g = 'code-oss'",
"100:class_g = 'Meld'",
"70:class_g = 'TelegramDesktop'",
"90:class_g = 'Joplin'",
"100:class_g = 'firefox'",
"100:class_g = 'Thunderbird'",
];
#################################
@ -227,62 +161,44 @@ opacity-rule = [
# Parameters for background blurring, see the *BLUR* section for more information.
# blur-method =
# blur-size = 12
blur-size = 24
#
# blur-deviation = false
blur-deviation = true
# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
# blur-background = true;
# blur-background = false
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
# Bad in performance, with driver-dependent behavior. The name may change.
#
# blur-background-frame = false;
# blur-background-frame = false
# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false;
blur-background-fixed = true
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ''
# blur-kern = "3x3box";
#blur-kern = "3x3box";
blur: {
# requires: https://github.com/ibhagwan/picom
method = "kawase";
#method = "kernel";
strength = 7;
# deviation = 1.0;
# kernel = "11x11gaussian";
background = false;
background-frame = false;
background-fixed = false;
kern = "3x3box";
}
# Exclude conditions for background blur.
# blur-background-exclude = []
blur-background-exclude = [
#"window_type = 'dock'",
#"window_type = 'desktop'",
#"class_g = 'URxvt'",
#
# prevents picom from blurring the background
# when taking selection screenshot with `main`
# https://github.com/naelstrof/maim/issues/130
"class_g = 'slop'",
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
@ -293,10 +209,8 @@ blur-background-exclude = [
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
experimental-backends = true;
backend = "glx";
#backend = "xrender";
# backend = 'glx'
backend = "xr_glx_hybrid";
# Enable/disable VSync.
# vsync = false
@ -349,7 +263,7 @@ refresh-rate = 0
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious.
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false
@ -410,9 +324,7 @@ detect-client-leader = true
# The opposing option is use-damage
#
# no-use-damage = false
#use-damage = true (Causing Weird Black semi opaque rectangles when terminal is opened)
#Changing use-damage to false fixes the problem
use-damage = false
use-damage = true
# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
@ -455,7 +367,7 @@ use-damage = false
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "info";
log-level = "warn";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
@ -503,7 +415,6 @@ log-level = "info";
#
wintypes:
{
normal = { fade = false; shadow = false; }
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; }
dnd = { shadow = false; }

Binary file not shown.

Binary file not shown.

View File

@ -1,34 +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
# acpi alternative
# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit
# Loop through all attached batteries.
for battery in /sys/class/power_supply/BAT?
do
# Get its remaining capacity and charge status.
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)
# If it is discharging and 25% or less, we will add a ❗ as a warning.
[ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
printf "%s%s%s%% " "$status" "$warn" "$capacity"
unset warn
done | sed 's/ *$//'

View File

@ -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"

View File

@ -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}'

View File

@ -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"

View File

@ -1,54 +0,0 @@
#!/bin/sh
# Shows the price for desired cryptocurrencies. Module updates automatically
# every calendar day, but can also be updated with a middle click.
# Currencies should be ;-separated:
# human-readable name;urlname;icon
coins="Bitcoin;btc;💰
Etherium;eth;🍸
Basic Attention Token;bat;🦁
LBC;lbc;📚"
# Directory where currency info is stored.
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
getprices() { # The command to get the desired prices
printf "🔃 "; printprices
{ rm -rf "${dir:?}/*"
echo "$coins" | while IFS=';' read -r human web icon; do
val="$(curl -s "rate.sx/1$web")" &&
echo "$icon;$val;$human" > "$dir/$web"
done; [ -d "$dir" ] && touch "$dir"
pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" ;} &
exit
}
printprices() { # Print/format all prices
for x in "$dir"/*; do
[ -f "$x" ] || break
info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")"
printf "%s$%0.2f " "$info"
done | sed 's/ $/\n/'
}
[ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;}
# 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')" ] &&
{ ping -q -c 1 example.org >/dev/null 2>&1 && getprices || exit ;}
case $BLOCK_BUTTON in
1) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
notify-send "Exact prices in USD" "$(awk -F';' '{print $1, $3 ":\n\t$" $2}' "$dir"/*)
<b>Last updated:</b>
$uptime" ;;
2) getprices ;;
3) notify-send "💸 Crypto-currency module" "\- Left click for exact prices.
- Middle click to update.
- Shows 🔃 if updating prices.
- Manually add/remove currencies to list in the script." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
printprices

View File

@ -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}')"

View File

@ -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]\\+" | 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

View File

@ -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 "❓"

View File

@ -1,24 +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
📡: no wifi connection
📶: wifi connection with quality
❎: no ethernet
🌐: ethernet working
🔒: vpn is active
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) wifiicon="📡 " ;;
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
esac
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)"

View File

@ -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/;.*//"

View File

@ -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"

View File

@ -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 sync >/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"

View File

@ -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))}'

View File

@ -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

View File

@ -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

View File

@ -1,19 +0,0 @@
#!/bin/sh
filter() { mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ' -;}
pidof -x mpdup >/dev/null 2>&1 || 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

View File

@ -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)

View File

@ -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)"

View File

@ -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 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"

View File

@ -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 _

View File

@ -1,38 +0,0 @@
#!/bin/sh
# Usage:
# price <url> <Name of currency> <icon>
# price bat "Basic Attention Token" 🦁
# When the name of the currency is multi-word, put it in quotes.
[ -z "$3" ] && exit 1
interval="@14d" # History contained in chart preceded by '@' (7d = 7 days)
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
pricefile="$dir/$1"
chartfile="$dir/$1-chart"
updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 &&
curl -s "rate.sx/1$1" > "$pricefile" &&
curl -s "rate.sx/$1$interval" > "$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 -Sf "$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
printf "$3$%0.2f" "$(cat "$pricefile")"

View File

@ -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

View File

@ -1,28 +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" -lt "30" ]; then
icon="🔈"
else
icon="🔉"
fi
echo "$icon$vol%"