chore: small updates
1a947eb8
5 file(s) · +312 −0
| 1 | + | # ~/.cwmrc |
|
| 2 | + | ||
| 3 | + | fontname "sans-serif:pixelsize=14" |
|
| 4 | + | sticky yes |
|
| 5 | + | gap 0 0 0 0 |
|
| 6 | + | ||
| 7 | + | # Applications |
|
| 8 | + | command "term" "st" |
|
| 9 | + | ||
| 10 | + | # Key bindings |
|
| 11 | + | # NOTE: cwm modifier prefixes are C=Control, M=Meta/Alt, S=Shift, 4=Mod4(Super/Windows), 5=Mod5(AltGr) |
|
| 12 | + | # The Super/"Mod" key on this keyboard is Mod4, so it must be written as "4-", not "M-". |
|
| 13 | + | bind-key 4-Return terminal |
| 1 | + | ;========================================================== |
|
| 2 | + | ; |
|
| 3 | + | ; |
|
| 4 | + | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ |
|
| 5 | + | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ |
|
| 6 | + | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ |
|
| 7 | + | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ |
|
| 8 | + | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ |
|
| 9 | + | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ |
|
| 10 | + | ; |
|
| 11 | + | ; |
|
| 12 | + | ; To learn more about how to configure Polybar |
|
| 13 | + | ; go to https://github.com/polybar/polybar |
|
| 14 | + | ; |
|
| 15 | + | ; The README contains a lot of information |
|
| 16 | + | ; |
|
| 17 | + | ;========================================================== |
|
| 18 | + | ||
| 19 | + | [colors] |
|
| 20 | + | background = #121113 |
|
| 21 | + | background-alt = #333333 |
|
| 22 | + | foreground = #c1c1c1 |
|
| 23 | + | primary = #fbcb97 |
|
| 24 | + | secondary = #5f8787 |
|
| 25 | + | alert = #e78a53 |
|
| 26 | + | disabled = #888888 |
|
| 27 | + | ||
| 28 | + | [bar/main] |
|
| 29 | + | width = 100% |
|
| 30 | + | height = 24pt |
|
| 31 | + | radius = 6 |
|
| 32 | + | ||
| 33 | + | ; dpi = 96 |
|
| 34 | + | ||
| 35 | + | background = ${colors.background} |
|
| 36 | + | foreground = ${colors.foreground} |
|
| 37 | + | ||
| 38 | + | line-size = 3pt |
|
| 39 | + | ||
| 40 | + | border-size = 4pt |
|
| 41 | + | border-color = #00000000 |
|
| 42 | + | ||
| 43 | + | padding-left = 0 |
|
| 44 | + | padding-right = 1 |
|
| 45 | + | ||
| 46 | + | module-margin = 1 |
|
| 47 | + | ||
| 48 | + | separator = | |
|
| 49 | + | separator-foreground = ${colors.disabled} |
|
| 50 | + | ||
| 51 | + | font-0 = BerkeleyMono Nerd Font:size=10;2 |
|
| 52 | + | ||
| 53 | + | modules-left = xworkspaces xwindow |
|
| 54 | + | modules-right = filesystem pulseaudio memory cpu wlan eth systray date |
|
| 55 | + | ||
| 56 | + | cursor-click = pointer |
|
| 57 | + | cursor-scroll = ns-resize |
|
| 58 | + | ||
| 59 | + | enable-ipc = true |
|
| 60 | + | ||
| 61 | + | ; wm-restack = generic |
|
| 62 | + | ; wm-restack = bspwm |
|
| 63 | + | ; wm-restack = i3 |
|
| 64 | + | ||
| 65 | + | ; override-redirect = true |
|
| 66 | + | ||
| 67 | + | ; This module is not active by default (to enable it, add it to one of the |
|
| 68 | + | ; modules-* list above). |
|
| 69 | + | ; Please note that only a single tray can exist at any time. If you launch |
|
| 70 | + | ; multiple bars with this module, only a single one will show it, the others |
|
| 71 | + | ; will produce a warning. Which bar gets the module is timing dependent and can |
|
| 72 | + | ; be quite random. |
|
| 73 | + | ; For more information, see the documentation page for this module: |
|
| 74 | + | ; https://polybar.readthedocs.io/en/stable/user/modules/tray.html |
|
| 75 | + | [module/systray] |
|
| 76 | + | type = internal/tray |
|
| 77 | + | ||
| 78 | + | format-margin = 8pt |
|
| 79 | + | tray-spacing = 16pt |
|
| 80 | + | ||
| 81 | + | [module/xworkspaces] |
|
| 82 | + | type = internal/xworkspaces |
|
| 83 | + | ||
| 84 | + | label-active = %name% |
|
| 85 | + | label-active-background = ${colors.background-alt} |
|
| 86 | + | label-active-underline= ${colors.primary} |
|
| 87 | + | label-active-padding = 1 |
|
| 88 | + | ||
| 89 | + | label-occupied = %name% |
|
| 90 | + | label-occupied-padding = 1 |
|
| 91 | + | ||
| 92 | + | label-urgent = %name% |
|
| 93 | + | label-urgent-background = ${colors.alert} |
|
| 94 | + | label-urgent-padding = 1 |
|
| 95 | + | ||
| 96 | + | label-empty = %name% |
|
| 97 | + | label-empty-foreground = ${colors.disabled} |
|
| 98 | + | label-empty-padding = 1 |
|
| 99 | + | ||
| 100 | + | [module/xwindow] |
|
| 101 | + | type = internal/xwindow |
|
| 102 | + | label = %title:0:60:...% |
|
| 103 | + | ||
| 104 | + | [module/filesystem] |
|
| 105 | + | type = internal/fs |
|
| 106 | + | interval = 25 |
|
| 107 | + | ||
| 108 | + | mount-0 = / |
|
| 109 | + | ||
| 110 | + | label-mounted = %{F#fbcb97}%mountpoint%%{F-} %percentage_used%% |
|
| 111 | + | ||
| 112 | + | label-unmounted = %mountpoint% not mounted |
|
| 113 | + | label-unmounted-foreground = ${colors.disabled} |
|
| 114 | + | ||
| 115 | + | [module/pulseaudio] |
|
| 116 | + | type = internal/pulseaudio |
|
| 117 | + | ||
| 118 | + | format-volume-prefix = "VOL " |
|
| 119 | + | format-volume-prefix-foreground = ${colors.primary} |
|
| 120 | + | format-volume = <label-volume> |
|
| 121 | + | ||
| 122 | + | label-volume = %percentage%% |
|
| 123 | + | ||
| 124 | + | label-muted = muted |
|
| 125 | + | label-muted-foreground = ${colors.disabled} |
|
| 126 | + | ||
| 127 | + | [module/xkeyboard] |
|
| 128 | + | type = internal/xkeyboard |
|
| 129 | + | blacklist-0 = num lock |
|
| 130 | + | ||
| 131 | + | label-layout = %layout% |
|
| 132 | + | label-layout-foreground = ${colors.primary} |
|
| 133 | + | ||
| 134 | + | label-indicator-padding = 2 |
|
| 135 | + | label-indicator-margin = 1 |
|
| 136 | + | label-indicator-foreground = ${colors.background} |
|
| 137 | + | label-indicator-background = ${colors.secondary} |
|
| 138 | + | ||
| 139 | + | [module/memory] |
|
| 140 | + | type = internal/memory |
|
| 141 | + | interval = 2 |
|
| 142 | + | format-prefix = "RAM " |
|
| 143 | + | format-prefix-foreground = ${colors.primary} |
|
| 144 | + | label = %percentage_used:2%% |
|
| 145 | + | ||
| 146 | + | [module/cpu] |
|
| 147 | + | type = internal/cpu |
|
| 148 | + | interval = 2 |
|
| 149 | + | format-prefix = "CPU " |
|
| 150 | + | format-prefix-foreground = ${colors.primary} |
|
| 151 | + | label = %percentage:2%% |
|
| 152 | + | ||
| 153 | + | [network-base] |
|
| 154 | + | type = internal/network |
|
| 155 | + | interval = 5 |
|
| 156 | + | format-connected = <label-connected> |
|
| 157 | + | format-disconnected = <label-disconnected> |
|
| 158 | + | label-disconnected = %{F#fbcb97}%ifname%%{F#888888} disconnected |
|
| 159 | + | ||
| 160 | + | [module/wlan] |
|
| 161 | + | inherit = network-base |
|
| 162 | + | interface-type = wireless |
|
| 163 | + | label-connected = %{F#fbcb97}%ifname%%{F-} %essid% %local_ip% |
|
| 164 | + | ||
| 165 | + | [module/eth] |
|
| 166 | + | inherit = network-base |
|
| 167 | + | interface-type = wired |
|
| 168 | + | label-connected = %{F#fbcb97}%ifname%%{F-} %local_ip% |
|
| 169 | + | ||
| 170 | + | [module/date] |
|
| 171 | + | type = internal/date |
|
| 172 | + | interval = 1 |
|
| 173 | + | ||
| 174 | + | date = %H:%M |
|
| 175 | + | date-alt = %Y-%m-%d %H:%M:%S |
|
| 176 | + | ||
| 177 | + | label = %date% |
|
| 178 | + | label-foreground = ${colors.primary} |
|
| 179 | + | ||
| 180 | + | [settings] |
|
| 181 | + | screenchange-reload = true |
|
| 182 | + | pseudo-transparency = true |
|
| 183 | + | ||
| 184 | + | ; vim:ft=dosini |
| 1 | + | #!/bin/sh |
|
| 2 | + | # Start the polybar bar defined in ./config.ini (installed at |
|
| 3 | + | # ~/.config/polybar/config.ini), replacing any bar already running. |
|
| 4 | + | # |
|
| 5 | + | # Meant to be run as the XFCE session client that used to be xfce4-panel — |
|
| 6 | + | # see ../xfce/polybar-panel.sh, which does that swap. |
|
| 7 | + | set -u |
|
| 8 | + | ||
| 9 | + | # Ask a running polybar to quit over IPC, falling back to a signal. |
|
| 10 | + | polybar-msg cmd quit >/dev/null 2>&1 || pkill -u "$(id -u)" -x polybar |
|
| 11 | + | ||
| 12 | + | # Wait for it to actually let go of the bar window before claiming it. |
|
| 13 | + | i=0 |
|
| 14 | + | while pgrep -u "$(id -u)" -x polybar >/dev/null 2>&1 && [ "$i" -lt 20 ]; do |
|
| 15 | + | sleep 0.2 |
|
| 16 | + | i=$((i + 1)) |
|
| 17 | + | done |
|
| 18 | + | ||
| 19 | + | # exec so the session manager tracks polybar itself, not this wrapper. |
|
| 20 | + | exec polybar main |
| 1 | + | #!/bin/sh |
|
| 2 | + | # Requires: xfconf-query (xfce4-settings), polybar |
|
| 3 | + | # Swaps xfce4-panel out of the XFCE session for polybar, and can put the |
|
| 4 | + | # panel back. |
|
| 5 | + | # |
|
| 6 | + | # xfce4-panel is not an autostart .desktop entry — xfce4-session launches it |
|
| 7 | + | # as one of its own session clients, so it has to be replaced there. This is |
|
| 8 | + | # a script rather than a checked-in xfconf XML file for the same reason as |
|
| 9 | + | # rofi-keybinds.sh: xfconf rewrites its config atomically, by rename, which |
|
| 10 | + | # would replace a symlink from this repo with a regular file. |
|
| 11 | + | # |
|
| 12 | + | # Usage: polybar-panel.sh apply (idempotent, safe to re-run) |
|
| 13 | + | # polybar-panel.sh --remove put xfce4-panel back |
|
| 14 | + | # polybar-panel.sh --list show which session clients run what |
|
| 15 | + | # |
|
| 16 | + | # Applying also swaps the running session live; no logout needed. |
|
| 17 | + | set -u |
|
| 18 | + | ||
| 19 | + | CHANNEL=xfce4-session |
|
| 20 | + | BACKUP="${XDG_DATA_HOME:-$HOME/.local/share}/polybar-panel.backup" |
|
| 21 | + | ||
| 22 | + | # Where the polybar launcher lives. The repo layout is the default; point |
|
| 23 | + | # POLYBAR_LAUNCH somewhere else to use an installed copy instead. |
|
| 24 | + | LAUNCH=${POLYBAR_LAUNCH:-$(CDPATH= cd -- "$(dirname -- "$0")/../polybar" 2>/dev/null && pwd)/launch.sh} |
|
| 25 | + | [ -f "$LAUNCH" ] || LAUNCH="$HOME/.config/polybar/launch.sh" |
|
| 26 | + | [ -x "$LAUNCH" ] || { echo "polybar-panel: no executable launcher at $LAUNCH" >&2; exit 1; } |
|
| 27 | + | ||
| 28 | + | command -v xfconf-query >/dev/null 2>&1 || |
|
| 29 | + | { echo "polybar-panel: xfconf-query not found — is this an XFCE session?" >&2; exit 1; } |
|
| 30 | + | command -v polybar >/dev/null 2>&1 || |
|
| 31 | + | { echo "polybar-panel: polybar is not installed" >&2; exit 1; } |
|
| 32 | + | ||
| 33 | + | # Every session client command in every stored session, as "prop<TAB>[cmd,args]". |
|
| 34 | + | clients() { |
|
| 35 | + | xfconf-query -c "$CHANNEL" -lv | |
|
| 36 | + | sed -n 's|^\(/sessions/[^/]*/Client[0-9]*_Command\) *\(\[.*\]\)$|\1\t\2|p' |
|
| 37 | + | } |
|
| 38 | + | ||
| 39 | + | # Set an array property from a "[a,b,c]" literal. |
|
| 40 | + | set_array() { |
|
| 41 | + | prop=$1 |
|
| 42 | + | args="" |
|
| 43 | + | IFS=, |
|
| 44 | + | for word in $(printf '%s' "$2" | sed 's/^\[//; s/\]$//'); do |
|
| 45 | + | args="$args -t string -s $word" |
|
| 46 | + | done |
|
| 47 | + | unset IFS |
|
| 48 | + | # shellcheck disable=SC2086 |
|
| 49 | + | xfconf-query -c "$CHANNEL" -p "$prop" $args --force-array |
|
| 50 | + | } |
|
| 51 | + | ||
| 52 | + | case "${1:-}" in |
|
| 53 | + | --list) |
|
| 54 | + | clients | while IFS=' ' read -r prop cmd; do |
|
| 55 | + | printf '%-45s %s\n' "$prop" "$cmd" |
|
| 56 | + | done |
|
| 57 | + | ;; |
|
| 58 | + | --remove) |
|
| 59 | + | [ -f "$BACKUP" ] || { echo "polybar-panel: nothing to restore ($BACKUP not found)" >&2; exit 1; } |
|
| 60 | + | while IFS=' ' read -r prop cmd; do |
|
| 61 | + | [ -n "${prop:-}" ] || continue |
|
| 62 | + | set_array "$prop" "$cmd" |
|
| 63 | + | echo "restored $prop -> $cmd" |
|
| 64 | + | done <"$BACKUP" |
|
| 65 | + | rm -f "$BACKUP" |
|
| 66 | + | polybar-msg cmd quit >/dev/null 2>&1 || pkill -u "$(id -u)" -x polybar |
|
| 67 | + | [ -n "${DISPLAY:-}" ] && command -v xfce4-panel >/dev/null 2>&1 && |
|
| 68 | + | (xfce4-panel >/dev/null 2>&1 &) |
|
| 69 | + | ;; |
|
| 70 | + | "") |
|
| 71 | + | found=0 |
|
| 72 | + | clients | while IFS=' ' read -r prop cmd; do |
|
| 73 | + | case "$cmd" in |
|
| 74 | + | "[xfce4-panel"*) |
|
| 75 | + | printf '%s\t%s\n' "$prop" "$cmd" >>"$BACKUP" |
|
| 76 | + | set_array "$prop" "[$LAUNCH]" |
|
| 77 | + | echo "$prop -> $LAUNCH" |
|
| 78 | + | ;; |
|
| 79 | + | esac |
|
| 80 | + | done |
|
| 81 | + | clients | grep -q "$LAUNCH" && found=1 |
|
| 82 | + | [ "$found" = 1 ] || { echo "polybar-panel: no xfce4-panel session client found" >&2; exit 1; } |
|
| 83 | + | if [ -n "${DISPLAY:-}" ]; then |
|
| 84 | + | pgrep -u "$(id -u)" -x xfce4-panel >/dev/null 2>&1 && |
|
| 85 | + | xfce4-panel --quit >/dev/null 2>&1 |
|
| 86 | + | "$LAUNCH" >/dev/null 2>&1 & |
|
| 87 | + | echo "polybar started; xfce4-panel stopped" |
|
| 88 | + | fi |
|
| 89 | + | ;; |
|
| 90 | + | *) |
|
| 91 | + | echo "usage: polybar-panel.sh [--remove|--list]" >&2 |
|
| 92 | + | exit 1 |
|
| 93 | + | ;; |
|
| 94 | + | esac |
| 265 | 265 | export PATH="$FNM_PATH:$PATH" |
|
| 266 | 266 | eval "$(fnm env --shell zsh)" |
|
| 267 | 267 | fi |
|
| 268 | + | export NO_AT_BRIDGE=1 # stops GTK apps relaunching it |