commit 2f3fcfc54b9d519a80e29371cd2202375a50ebf0 from: gonzalo date: Sat May 22 22:02:57 2021 UTC add termbar and other files for the complete experience (?) commit - c43726e957a8e6e1c2dfae466842090b97d72af7 commit + 2f3fcfc54b9d519a80e29371cd2202375a50ebf0 blob - /dev/null blob + f83bfafe700865b10bbb181cdfd54ebdd7a274e4 (mode 644) --- /dev/null +++ .Xdefaults @@ -0,0 +1,63 @@ +!!! Colours +*color0: rgb:2a/3b/4d +*color1: rgb:c4/67/6c +*color2: rgb:66/ff/66 +*color3: rgb:ff/ff/66 +*color4: rgb:15/f4/ee +*color5: rgb:9c/6c/d3 +*color6: rgb:4b/8f/77 +*color7: rgb:9f/a2/a6 +*color8: rgb:55/79/9c +*color9: rgb:c4/67/6c +*color10: rgb:66/ff/66 +*color11: rgb:ff/ff/66 +*color12: rgb:15/f4/ee +*color13: rgb:9c/6c/d3 +*color14: rgb:4b/8f/77 +*color15: rgb:ff/ff/ff +*color16: rgb:ff/99/66 # Base 09 +*color17: rgb:bb/64/a9 # Base 0F +*color18: rgb:3d/56/6f # Base 01 +*color19: rgb:4b/69/88 # Base 02 +*color20: rgb:7e/90/a3 # Base 04 +*color21: rgb:d6/d7/d9 # Base 06 + +!!! Xterm +!!! XTerm*background: rgb:2a/3b/4d +XTerm*background: black +XTerm*foreground: rgb:9f/a2/a6 +XTerm*eightBitInput: false +XTerm*loginShell: true +XTerm*scrollBar: false +XTerm*saveLines: 2000 +XTerm*faceName: xft:monospace:pixelsize=16 +XTerm*internalBorder: 10 +XTerm*locale: true +XTerm*pointerMode: 2 +XTerm*allowTitleOps: true +XTerm*termName: xterm-256color + +!!! termbar +termbar*faceName: xft:mono:pixelsize=24 +!! One Monitor !!termbar*geometry: 1920x1+0+0 +!! Two Monitors !! +termbar*geometry: 3840x1+0+0 +termbar*internalBorder: 6 +termbar*saveLines: 0 +termbar*scrollBar: false +termbar*title: termbar + +!!! Xconsole +XConsole*internalBorder: 5 +XConsole*scrollBar: false +XConsole*faceName: xft:monospace:pixelsize=10 + +!!! xLock +XLock.nice: 19 +XLock.mode: blank +XIdle.timeout: 600 +XLock.usefirst: yes +XLock.grabmouse: on +XLock.lockdelay: 10 +XLock.mousemotion: on + blob - /dev/null blob + 842f10a50711dbe280724709c3eb56fcde7b22ac (mode 755) --- /dev/null +++ .cwmrc @@ -0,0 +1,75 @@ +# KEYBINDINGS: +# 4 = mod (windows key) +# S = shift +# C = control +# M = meta (alt) + +# Autogroups for windows. +autogroup 0 xconsole,XConsole +autogroup 0 "termbar,termbar" +autogroup 2 "firefox,firefox-bin" +autogroup 9 "tor-browser,tor-browser" + +# Add missing keybindings. +bind-key M-1 group-only-1 +bind-key M-2 group-only-2 +bind-key M-3 group-only-3 +bind-key M-4 group-only-4 +bind-key M-5 group-only-5 +bind-key M-6 group-only-6 +bind-key M-7 group-only-7 +bind-key M-8 group-only-8 +bind-key M-9 group-only-9 +bind-key MS-1 window-movetogroup-1 +bind-key MS-2 window-movetogroup-2 +bind-key MS-3 window-movetogroup-3 +bind-key MS-4 window-movetogroup-4 +bind-key MS-5 window-movetogroup-5 +bind-key MS-6 window-movetogroup-6 +bind-key MS-7 window-movetogroup-7 +bind-key MS-8 window-movetogroup-8 +bind-key MS-9 window-movetogroup-9 + +bind-key MS-space window-htile +bind-key M-space window-vtile + +bind-key C-Up pointer-move-up +bind-key C-Down pointer-move-down +bind-key C-Right pointer-move-right +bind-key C-Left pointer-move-left + +bind-key CS-Up pointer-move-up-bigbind-key +bind-key CS-Down pointer-move-down-big +bind-key CS-Right pointer-move-right-big +bind-key CS-Left pointer-move-left-big + +bind-key MS-l lock +bind-key MS-r restart +bind-key MS-q quit +bind-key MS-Return terminal +bind-key MS-p menu-exec + +bind-mouse M-2 window-lower +bind-mouse M-3 window-resize + +## Windows +borderwidth 4 +color activeborder '#202060' +color font '#000000' +color selfont '#e9ffe9' +color inactiveborder 'rgb:33/33/33' +color menubg '#494949' +color menufg '#202060' + +fontname "dejavu sans mono:size=12" +gap 35 5 5 5 + +ignore "xconsole" +ignore "termbar" + +command firefox firefox +command xterm xterm + +moveamount 4 +snapdist 25 +sticky yes blob - /dev/null blob + a4c22c223bded753fc2d2b0e9dd9abdce4a6d455 (mode 644) --- /dev/null +++ .xsession @@ -0,0 +1,27 @@ +#!/bin/sh -x + +xrdb -merge $HOME/.Xresources + +export LANG=en_US.UTF-8 +export LC_CTYPE=en_US.UTF-8 +export XMODIFIERS=@im=uim +export GTK_IM_MODULE="uim" +export MOZ_USE_XINPUT2=1 +export MOZ_ACCELERATED=1 +export MOZ_WEBRENDER=1 + +## no bell +xset b 0 0 0 + +# DBus +if [ -x /usr/local/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then + eval `dbus-launch --sh-syntax --exit-with-x11` +fi + +# Termbar +exec xterm -fs 12 -bg "black" -fg "grey" -name termbar -class termbar -T termbar -e ~/code/termbar & + +# Wallpaper +feh --bg-center ~/themes/blade-runner--wallpaper.jpg & + +exec cwm blob - /dev/null blob + b69ee834954057f5ab12b499835a1e5ed33c2188 (mode 644) --- /dev/null +++ LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 gonzalo- + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. blob - /dev/null blob + 921b65a67c07750dd464851bcf88f87cfd99be7b (mode 644) --- /dev/null +++ README.md @@ -0,0 +1,3 @@ +# termbar - depsless status bar for OpenBSD + +xterm status bar for cwm (or other wm) on OpenBSD (no idea if works on loonix or other OS). blob - /dev/null blob + 7dd086ad110772e589992fe78f8ba49b744bcbbd (mode 644) Binary files /dev/null and screenshot.png differ blob - /dev/null blob + b2aa52ff81df3beba940be148ce94052c5fadf10 (mode 755) --- /dev/null +++ termbar @@ -0,0 +1,88 @@ +#!/bin/sh + +## Debug +#set -x + +trap 'exec $0' HUP # Restart itself +trap 'tput cnorm; exit 1' INT QUIT TERM + +esc="\033" +reset="${esc}[0m" +redf="${esc}[31m" +cyanf="${esc}[36m"; +purplef="${esc}[35m" +pipe="${purplef}|${reset}" + +today() +{ + DATE=$(date '+%a %d %b %H:%M') +} + +desktop_id() +{ + DESKTOP_ID=$(xprop -root 32c '\t$0' _NET_CURRENT_DESKTOP | cut -f 2) +} + +cpu() +{ +# CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1) + CPU_TEMP=$(sysctl hw.sensors.acpithinkpad0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1) + + CPU_SPEED=$(printf "%4s" $(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1)) +} + +bat() +{ + BAT=$(apm -l) +} + +bat_status() +{ + STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | grep -c On) + + if [ ${STATUS} -eq "1" ]; then + BAT_STATUS=$(echo Connected) + else + BAT_STATUS=$(echo ${redf}Disconnected${reset}) + fi +} + +mem() +{ + MEM=$(top -n | grep Memory | awk {'print $6'}) +} + +wifi() +{ + SSID=$(ifconfig | grep join | sed -e 's/.*join\(.*\)chan.*/\1/') +} + +network() +{ + IIP=$(ifconfig iwm0 | grep inet | awk '{print $2}') + PIP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'}) +} + +my_name() +{ + YO=$(printf "ゴンザロ") +} + +tput civis + +while true; do + today + desktop_id + cpu + mem + bat + bat_status + wifi + network + my_name + tput cup 1 0 + printf "[${DESKTOP_ID}] ${pipe} ${cyanf}${YO}${reset} ${pipe} ${DATE} ${pipe} ${cyanf}CPU:${reset} ${CPU_SPEED} MHz (${CPU_TEMP}°) ${pipe} ${cyanf}Mem:${reset} ${MEM} " + printf "${pipe} ${cyanf}Bat:${reset} $BAT - ${BAT_STATUS} ${pipe} ${cyanf}SSID:${reset}${SSID}${pipe}" + printf " ${cyanf}IPs:${reset} ${PIP} / ${IIP} \r\r" + sleep 1 +done