Krolyxon
Commit c866ba8

Branches

Refs →

dotfiles-x11c866ba8

switch to dwmblocks

Author
krolyxon
Date
2023-03-21 21:47 +0530
Parent
88bcaeb
Commit
c866ba828c2b65feec1a05863682dd78bf5d5af7

+31 −107

9 files changed

  1. M .config/x11/xinitrc +2 −2
  2. D .local/bin/sb-music +0 −19
  3. D .local/bin/sbar +0 −84
  4. A .local/bin/statusbar/sb-clock +2 −0
  5. A .local/bin/statusbar/sb-memory +2 −0
  6. R .local/bin/sb-mpdup → .local/bin/statusbar/sb-mpdup +1 −1
  7. A .local/bin/statusbar/sb-music +11 −0
  8. A .local/bin/statusbar/sb-volume +2 −0
  9. M .local/share/vocab/words.txt +11 −1
M .config/x11/xinitrc View
@@ -5,7 +5,7 @@ xwallpaper --zoom ~/.local/share/wallpaper.jpg &
55 xcompmgr &
66 xset r rate 300 50
77 unclutter &
8−sbar &
8+dwmblocks &
99 dunst &
10−# exec dwm > /dev/null 2>&1
10+# exec dwm > /dev/null 2>&1
1111 while type dwm > /dev/null ; do dwm && continue || break ; done
D .local/bin/sb-music View
@@ -1,19 +0,0 @@
1−#!/bin/sh
2−
3−filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
4−
5−pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
6−
7−case $BLOCK_BUTTON in
8− 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause
9− 2) mpc toggle | filter ;; # right click, pause/unpause
10− 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
11−- ⏸ when paused.
12−- Left click opens ncmpcpp.
13−- Middle click pauses.
14−- Scroll changes track.";; # right click, pause/unpause
15− 4) mpc prev | filter ;; # scroll up, previous
16− 5) mpc next | filter ;; # scroll down, next
17− 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
18− *) mpc status | filter ;;
19−esac
D .local/bin/sbar View
@@ -1,84 +0,0 @@
1−#!/bin/env sh
2−
3−# INIT
4−printf "$$" > ~/.cache/pidofbar
5−sec=0
6−
7−# MODULES
8−update_cpu () {
9− cpu=" $(grep -o "^[^ ]*" /proc/loadavg )"
10−}
11−
12−update_memory () {
13− memory=" $(free -h --si | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")"
14−}
15−
16−update_time () {
17− time="$(date "+[  %a %d %b ] [  %I:%M %P ]")"
18−}
19−
20−update_music () {
21− # music="[ $(sb-music) ] "
22− if [ -z "$(sb-music)" ]; then
23− music=""
24− else
25− music="[ $(sb-music) ] "
26− fi
27−}
28−
29−# update_bat () {
30−# # you might need to change the path depending on your device
31−# read -r bat_status </sys/class/power_supply/BAT1/status
32−# read -r bat_capacity </sys/class/power_supply/BAT1/capacity
33−# bat="$bat_status $bat_capacity%"
34−# }
35−
36−update_vol () {
37− vol="$([ "$(pamixer --get-mute)" = "false" ] && printf ' ' || printf ' ')$(pamixer --get-volume)%"
38−}
39−
40−# For calcurse users, refer https://github.com/pystardust/automeet
41−#update_event () {
42−# event="$(calcurse -n | sed 1d | \
43−# sed -E "s_^ *\[(.*):(.*)\] ([^\t]*)\t?.*_[\1h \2m->\3]_")"
44−# [ "[]" = "$event" ] && event=""
45−#}
46−
47−
48−# modules that don't update on their own need to be run at the start for getting their initial value
49−# update_vol
50−
51−display () {
52− #printf "%s\n" " $event [$memory $cpu] [$bat] [$backlight] [$vol] $time "
53− xsetroot -name "$music[ $vol ] [ $memory $cpu ] $time "
54−}
55−
56−# SIGNALLING
57−# trap "<function>;display" "RTMIN+n"
58−trap "update_vol;display" "RTMIN"
59−trap "update_music;display" "RTMIN+10"
60−# trap "update_bat;display" "RTMIN+2"
61−# to update it from external commands
62−## kill -m "$(cat ~/.cache/pidofbar)"
63−# where m = 34 + n
64−
65−while true
66−do
67− sleep 1 & wait && {
68− # to update item ever n seconds with a offset of m
69− ## [ $((sec % n)) -eq m ] && udpate_item
70− [ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds
71− [ $((sec % 5 )) -eq 0 ] && update_vol # update vol every 5 seconds
72− [ $((sec % 5 )) -eq 0 ] && update_music # update music every 5 seconds
73− [ $((sec % 5)) -eq 0 ] && update_cpu # update cpu every 15 seconds
74− [ $((sec % 5)) -eq 0 ] && update_memory
75− # [ $((sec % 60)) -eq 0 ] && update_bat
76− #[ $((sec % 300)) -eq 1 ] && update_event
77−
78− # how often the display updates ( 5 seconds )
79− [ $((sec % 5 )) -eq 0 ] && display
80− sec=$((sec + 1))
81− }
82−done
83−
84−
A .local/bin/statusbar/sb-clock View
@@ -0,0 +1,2 @@
1+#!/bin/sh
2+echo "$(date "+[  %a %d %b ] [  %I:%M %P ]")"
A .local/bin/statusbar/sb-memory View
@@ -0,0 +1,2 @@
1+#!/bin/sh
2+echo "[  $(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB", ( $3 / 1024), ($2 / 1024))}') $(sensors | awk '/Core 0/ {print " " $3}') ]"
R .local/bin/sb-mpdup → .local/bin/statusbar/sb-mpdup View
@@ -4,5 +4,5 @@
44 # music player's status. mpd must be running on X's start for this to work.
55
66 while : ; do
7− mpc idle >/dev/null && kill -44 $(cat ~/.cache/pidofbar) || break
7+ mpc idle >/dev/null && kill -45 $(pidof dwmblocks) || break
88 done
A .local/bin/statusbar/sb-music View
@@ -0,0 +1,11 @@
1+#!/bin/sh
2+
3+filter() { mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
4+
5+pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
6+
7+if [ -z "$(filter)" ]; then
8+ echo ""
9+else
10+ echo "[ $(filter) ]"
11+fi
A .local/bin/statusbar/sb-volume View
@@ -0,0 +1,2 @@
1+#!/bin/sh
2+echo [ "$([ "$(pamixer --get-mute)" = "false" ] && printf ' ' || printf ' ')$(pamixer --get-volume)%" ]
M .local/share/vocab/words.txt View
@@ -91,7 +91,7 @@ eerie -> strange and frightening
9191 prepend -> add (something) to the beginning of something else
9292 notion -> a conception of or belief about something
9393 robust -> strong and healthy
94−mundane ->
94+mundane ->
9595 mundane -> lacking interest or excietement; dull.
9696 inevitable -> certain to happen; unavoidable.
9797 postulate -> suggest or assume the existence, fact, or truth of something as a basis for reasoning, discussion or belief.
@@ -103,3 +103,13 @@ ardent -> very enthusiastic or passionate.
103103 absolute -> existing independently and not in relation to other things
104104 reciprocal (mathematics) -> a multiplicative invers
105105 intuitive -> easy to use and understand.
106+ubiquitous -> found everywhere, present or appearing.
107+poofta -> a man who is considered effiminate or homosexual
108+camouflage -> it is the use of any combination of materials to either make objects hard to see or by disguising them as someting else.
109+aisle -> a passage between rows of seats in a building such as a curch or theatre, an aircraft or train.
110+ensemble -> a group of items viewed as a whole rather than individually.
111+traverse -> travel across or through, "he traversed the forest"
112+fiend -> an evil spirit or demon
113+contiguous -> sharing a common border; touching.
114+transgression -> an act that goes against a law, rule, or code of conduct.
115+onosecond -> its the fraction of time before one realizes that they have made a crucial mistake after the mistake was made