dotfiles

Dotfiles for my OpenBSD environment.
Log | Files | Refs

commit af31fc153c11ba78128431a8c0f42c4e579fc434
parent 33bb54676dd05e4127712ab675ad4a0fee76435f
Author: Matsuda Kenji <contact2655@matsudakenji.xyz>
Date:   Thu, 16 Jun 2022 09:07:06 +0900

declutter

Diffstat:
M.config/X11/xinitrc | 38+++-----------------------------------
M.config/mutt/muttrc | 2+-
Dbin/dwm_blocks_battery.sh | 12------------
Dbin/dwm_blocks_volume.sh | 6------
Dbin/dwm_blocks_wifi.sh | 4----
Abin/dwm_status | 22++++++++++++++++++++++
Dsuckless/dwmblocks/blocks.diff | 20--------------------
7 files changed, 26 insertions(+), 78 deletions(-)

diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc @@ -1,38 +1,6 @@ #!/bin/sh -export ENV=$HOME/.shrc - -# ~/ clean up: -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_RUNTIME_DIR="/tmp/xdg_runtime_dir_$USER" -export VIMINIT=":source $XDG_CONFIG_HOME"/vim/vimrc -export VIM="$XDG_CONFIG_HOME/vim" -[ ! -d $XDG_CONFIG_HOME ] && mkdir -p $XDG_CONFIG_HOME -[ ! -d $XDG_CACHE_HOME ] && mkdir -p $XDG_CACHE_HOME -[ ! -d $XDG_DATA_HOME ] && mkdir -p $XDG_DATA_HOME -[ ! -d $XDG_RUNTIME_DIR ] && mkdir -p $XDG_RUNTIME_DIR - -export HISTFILE="$XDG_CACHE_HOME/sh_history" - -export X11HOME="$XDG_CONFIG_HOME/X11" -export XINITRC="$X11HOME/xinitrc" -#export XAUTHORITY="$XDG_CACHE_HOME/X11/Xauthority" -[ ! -d $X11HOME ] && mkdir -p $X11HOME -[ ! -d $XDG_CACHE_HOME/X11 ] && mkdir -p $XDG_CACHE_HOME/X11 -#gnupg - -export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" - -# less -export LESSHISTFILE=- - -export BROWSER="firefox" -export TERMINAL="st" -export EDITOR="nvi" -export PATH="$PATH:$HOME/bin:/usr/local/heirloom-doctools/bin:$HOME/.local/src/kotoriotoko/BIN" -export LC_CTYPE=en_US.UTF-8 +. "$HOME/.profile" setxkbmap -layout jp userresources=$XDG_CONFIG_HOME/X11/Xresources @@ -56,7 +24,7 @@ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5 xinput set-prop "/dev/wsmouse" "Device Accel Constant Deceleration" 0.4 xsetroot -solid black -xidle -program "/usr/local/bin/slock"& +xidle -program "/usr/X11R6/bin/xlock"& -dwmblocks & +while :; do xsetroot -name "$(dwm_status)"; sleep 5; done & exec dwm diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc @@ -16,7 +16,7 @@ set ssl_starttls = yes set ssl_force_tls = yes # basic -set editor = "nim" +set editor = "nvi" set charset = "utf-8" set certificate_file = "./certificates" set mailcap_path = "~/.config/mutt/mailcap" diff --git a/bin/dwm_blocks_battery.sh b/bin/dwm_blocks_battery.sh @@ -1,12 +0,0 @@ -#!/bin/sh - -online=$(apm -a) -capacity=$(apm -l) - -if [ "$online" = "1" ]; then - state="AC" -else - state="BAT" -fi - -echo "$state ${capacity}" diff --git a/bin/dwm_blocks_volume.sh b/bin/dwm_blocks_volume.sh @@ -1,6 +0,0 @@ -#!/bin/sh - -mute=$(sndioctl -n output.mute) -[ "$mute" = 1 ] && state="MUTE" || state="VOL" -volume=$(printf '%.0f' $(echo $(sndioctl -n output.level) '*' 100 | bc)) -echo "$state ${volume}" diff --git a/bin/dwm_blocks_wifi.sh b/bin/dwm_blocks_wifi.sh @@ -1,4 +0,0 @@ -#!/bin/sh - -ifconfig em0 | awk '/active/{printf "ETH "}' -ifconfig iwn0 | awk '/active/{printf "WIFI "}/no network/{printf "down\n"}/join/{printf "%s\n", $3}' diff --git a/bin/dwm_status b/bin/dwm_status @@ -0,0 +1,22 @@ +#!/bin/sh +date=$(date '+%m/%d %a %H:%M') + +mute=$(sndioctl -n output.mute) +[ "$mute" = 1 ] && state="MUTE" || state="VOL" +volume=$(printf '%.0f' $(echo $(sndioctl -n output.level) '*' 100 | bc)) +volume="$state $volume" + +online=$(apm -a) +capacity=$(apm -l) +[ "$online" = "1" ] && state="AC" || state="BAT" +bat="$state $capacity" + +cpu="CPU $(uptime | sed 's/.*load averages: \(.*\)/\1/' | cut -d, -f1)" + +tmp="TMP $(sysctl -n hw.sensors.cpu0.temp0 | cut -d'.' -f1)" + +eth=$(ifconfig em0 | awk '/active/{printf "ETH "}') +wifi=$(ifconfig iwn0 | awk '/active/{printf "WIFI "}/no network/{printf "down\n"}/join/{printf "%s\n", $3}') +nw="$eth$wifi" + +printf "%s | %s | %s | %s | %s | %s" "$date" "$volume" "$bat" "$cpu" "$tmp" "$nw" diff --git a/suckless/dwmblocks/blocks.diff b/suckless/dwmblocks/blocks.diff @@ -1,20 +0,0 @@ ---- blocks.def.h 2021-06-18 14:21:18.113296000 +0900 -+++ blocks.h 2021-06-21 16:12:16.762548000 +0900 -@@ -1,11 +1,14 @@ - //Modify this file to change what commands output to your statusbar, and recompile using the make command. - static const Block blocks[] = { - /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ -- {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0}, -+ {"", "date '+%m/%d %a %H:%M'", 5, 0}, -+ {"", "dwm_blocks_volume.sh", 5, 10}, -+ {"", "dwm_blocks_battery.sh", 5, 0}, -+ {"", "uptime | sed 's/.*load averages: \\(.*\\)/\\1/' | cut -d, -f1", 5, 0}, -+ {" ", "sysctl dev.cpu | grep temperature | tr -d C | awk '{a+=$2;n++}END{printf \"%d\\n\", a/n}'", 5, 0}, -+ {"", "dwm_blocks_wifi.sh", 5, 0}, - -- {"", "date '+%b %d (%a) %I:%M%p'", 5, 0}, - }; -- - //sets delimeter between status commands. NULL character ('\0') means no delimeter. - static char delim[] = " | "; - static unsigned int delimLen = 5;