diff --git a/README b/README index af0a29a..535a060 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ SETUP ----- -do it in the order: BASICS, (if using laptop) POWER MANAGEMENT, SERVICES. +do it in the order: BASICS, (if using laptop), ALSA, POWER MANAGEMENT, SERVICES. Follow the knowledge section in any order. * SETUP @@ -18,6 +18,14 @@ Follow the knowledge section in any order. $ chsh -s /bin/zsh $ su -c "echo 'permit nopass keepenv :wheel' > /etc/doas.conf" +* ALSA + ---- + $ usermod -aG audio + $ # relogin + $ mkdir -p /etc/alsa/conf.d + $ ln -s /usr/share/alsa.conf.d/50-pipewire.conf . + $ ln -s /usr/share/alsa.conf.d/99-pipewire-default.conf + * POWER MANAGEMENT ---------------- @@ -83,7 +91,7 @@ TODO * pass/otp setup * backups * some MUA, mblaze? -* noise suppression, rnnoise, maybe use pipewire +* rnnoise/noise-suppression * cupload script * set user dirs + delete redundant * platinum9/nineicons for icons diff --git a/files/.config/dk/dkrc b/files/.config/dk/dkrc index 6fa173a..0e044e8 100755 --- a/files/.config/dk/dkrc +++ b/files/.config/dk/dkrc @@ -1,54 +1,20 @@ #!/bin/sh - -# example dkrc to provide a close-to-default setup and -# show some basic command usage with error reporting +set -e # determine where to place the log file logfile="$HOME/.dkrc.log" -[ -d "$HOME/.local/share/xorg" ] && logfile="$HOME/.local/share/xorg/dkrc.log" : > "$logfile" -date > "$logfile" +border_width=5 +border_outer_width=3 -# wallpaper -#xsetroot -solid '#101020' -xsetroot -solid gray70 - -# load sxhkd for keybinds -pgrep sxhkd || sxhkd -c "$HOME/.config/dk/sxhkdrc" & -pkill bar.sh; bar.sh & - -# adjust border widths based on the DPI of the monitor -px=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+x[0-9]\+' | cut -d'x' -f2) -mm=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+mm' | tail -n1 | sed 's/mm//') -dpi=$(( (px / mm) * 25 )) - -if [ $dpi -ge 140 ]; then - border_width=5 - border_outer_width=3 -elif [ $dpi -ge 120 ]; then - border_width=4 - border_outer_width=2 -else - border_width=2 - border_outer_width=1 -fi - -{ # compound command to redirect all output - - # workspace settings - # ------------------------ - - # initialize 9 workspaces (1-9) (default: 1/monitor) +{ + # 9 workspaces per monitor dkcmd set numws=9 # default workspace '_' values used when allocating new workspaces # can be applied to all existing workspaces when passed 'apply' after ws=_ - dkcmd set ws=_ apply layout=tile master=1 stack=4 gap=0 msplit=0.55 ssplit=0.5 - for w in $(seq 1 9); do dkcmd set ws=$w layout=tile master=1 stack=4 gap=0 msplit=0.55 ssplit=0.5; done - - # global settings - # --------------------- + dkcmd set ws=_ apply layout=tile master=1 stack=4 gap=6 msplit=0.55 ssplit=0.5 # focus windows when receiving activation and enable focus-follows-mouse dkcmd set focus_open=true focus_urgent=true focus_mouse=true @@ -68,25 +34,6 @@ fi # obey motif border hints on windows that draw their own (steam, easyeffects, etc.) dkcmd set obey_motif=true - - # borders - # --------- - - # traditional - # set border width and colour for each window state - # dkcmd set border width=$border_width colour focus='#6699cc' unfocus='#000000' urgent='#ee5555' - - # alternative - # enable split borders and colours, width is overall width, outer_width consumes some of width. - # outer_width must be less than width, outer_width of 0 will be single borders - #dkcmd set border width=$border_width outer_width=$border_outer_width \ - # colour \ - # focus='#6699cc' \ - # unfocus='#444444' \ - # urgent='#ee5555' \ - # outer_focus='#222222' \ - # outer_unfocus='#222222' \ - # outer_urgent='#222222' dkcmd set border width=$border_width outer_width=$border_outer_width \ colour \ focus='#fd0c0c' \ @@ -96,31 +43,10 @@ fi outer_unfocus='#3030ef' \ outer_urgent='#222222' - # window rules - # -------------- - - # rule class, instance, and title regex are *always* case INSENSITIVE - - dkcmd rule class="^dooble$" ws=2 + dkcmd rule class="^(dooble|firefox|librewolf)$" ws=2 dkcmd rule class="^discord$" ws=6 dkcmd rule class="^spotify$" ws=8 - - # open window(s) on a monitor by number or name (active workspace on monitor) - # dkcmd rule class="^chromium$" mon="HDMI-A-0" - - # open window(s) and use a callback function (user defined in config.h) - # we also ignore_cfg=true to stop the window from being resized on it's own from events - # eg. mpv --x11-name=albumart /path/to/media - # dkcmd rule class="^mpv$" instance="^albumart$" float=true ignore_cfg=true callback=albumart bw=0 - - # open window(s) in a floating state - dkcmd rule class="^(pavucontrol|transmission-gtk|steam|lxappearance)$" float=true - - # open window(s) with a specific geometry and coordinates (floating only!) - # dkcmd rule class="^google-chrome$" title="^open files$" float=true w=1280 h=720 - - # open window(s) with ignore_msg=true to avoid focus being grabbed and changing workspace - # dkcmd rule class="^TelegramDesktop$" ignore_msg=true + dkcmd rule class="^(mpv|nsxiv)$" float=true # define some terminals and allow them to be absorbed by spawned windows dkcmd rule class="^(st|lxterminal|st-256color|urxvt|kitty|alacritty|xterm|xterm-256color)$" terminal=true @@ -131,17 +57,9 @@ fi # focus window and workspace on opening # dkcmd rule class="^firefox$" ws=1 focus=true - # update or remove an existing rule with the same match patterns - # dkcmd rule class="^firefox$" mon="HDMI-A-0" - # dkcmd rule remove class="^firefox$" - # apply current rule set to all existing windows (used mainly for WM restart) dkcmd rule apply '*' - - # delete all rules - # dkcmd rule remove '*' - -} >> "$logfile" 2>&1 # append responses +} >> "$logfile" 2>&1 # inform of any errors in a notification if grep -q 'error:' "$logfile"; then @@ -150,4 +68,7 @@ if grep -q 'error:' "$logfile"; then exit 1 fi -exit 0 +env | while read -r pair; do + turnstile-update-runit-env "$(cut -d= -f1 <<< "$pair")" +done + diff --git a/files/.config/dk/sxhkdrc b/files/.config/dk/sxhkdrc index 7df3d1c..8bafc9d 100644 --- a/files/.config/dk/sxhkdrc +++ b/files/.config/dk/sxhkdrc @@ -13,10 +13,6 @@ super + s super + Tab dkcmd ws view last -# dedicated volume keys -{XF86AudioRaiseVolume,XF86AudioLowerVolume} - pamixer {-i,-d} 2 - # reload sxhkd super + shift + x pkill -USR1 -x sxhkd @@ -73,4 +69,14 @@ super + {_,shift + ,ctrl + }{comma,period,backslash} super + {_,shift + }{c,v} dkcmd set {master,stack} {+1,-1} +# volume keys +{XF86AudioRaiseVolume,XF86AudioLowerVolume} + pactl set-sink-volume @DEFAULT_SINK@ {+,-}5% +{XF86AudioMute,XF86AudioMicMute} + pactl set-{sink,source}-mute @DEFAULT_{SINK,SOURCE}@ toggle + +# media keys +super + {y,less,greater} + playerctl {play-pause,previous,next} + # vim:ft=sxhkdrc diff --git a/files/.config/pipewire/pipewire.conf.d/10-wireplumber.conf b/files/.config/pipewire/pipewire.conf.d/10-wireplumber.conf new file mode 120000 index 0000000..93f731a --- /dev/null +++ b/files/.config/pipewire/pipewire.conf.d/10-wireplumber.conf @@ -0,0 +1 @@ +/usr/share/examples/wireplumber/10-wireplumber.conf \ No newline at end of file diff --git a/files/.config/pipewire/pipewire.conf.d/20-pipewire-pulse.conf b/files/.config/pipewire/pipewire.conf.d/20-pipewire-pulse.conf new file mode 120000 index 0000000..19464c7 --- /dev/null +++ b/files/.config/pipewire/pipewire.conf.d/20-pipewire-pulse.conf @@ -0,0 +1 @@ +/usr/share/examples/pipewire/20-pipewire-pulse.conf \ No newline at end of file diff --git a/files/.config/service/bar/run b/files/.config/service/bar/run new file mode 100755 index 0000000..efdbd3d --- /dev/null +++ b/files/.config/service/bar/run @@ -0,0 +1,3 @@ +#!/bin/sh +pkill bar.sh +exec chpst -e "$TURNSTILE_ENV_DIR" env bar.sh diff --git a/files/.config/service/pipewire/run b/files/.config/service/pipewire/run new file mode 100755 index 0000000..ebda096 --- /dev/null +++ b/files/.config/service/pipewire/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -e "$TURNSTILE_ENV_DIR" pipewire diff --git a/files/.config/service/sshfs/run b/files/.config/service/sshfs/run index 0a5a74d..0491741 100755 --- a/files/.config/service/sshfs/run +++ b/files/.config/service/sshfs/run @@ -1,4 +1,4 @@ #!/bin/sh - mkdir -p ~/nfs -sshfs -o auto_unmount -f kentoj.de:nfs ~/nfs +exec chpst -e "$TURNSTILE_ENV_DIR" \ + sshfs -o auto_unmount -f kentoj.de:nfs ~/nfs diff --git a/files/.config/service/sxhkd/run b/files/.config/service/sxhkd/run new file mode 100755 index 0000000..d183f49 --- /dev/null +++ b/files/.config/service/sxhkd/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec chpst -e "$TURNSTILE_ENV_DIR" \ + sxhkd -c "$HOME/.config/dk/sxhkdrc" diff --git a/files/.config/vis/themes/kento2.lua b/files/.config/vis/themes/kento2.lua new file mode 100644 index 0000000..1e9d3be --- /dev/null +++ b/files/.config/vis/themes/kento2.lua @@ -0,0 +1,155 @@ +-- Eight-color scheme +local lexers = vis.lexers +lexers.STYLE_DEFAULT ='' +lexers.STYLE_NOTHING = '' +lexers.STYLE_ATTRIBUTE = 'fore:green,bold' +lexers.STYLE_CLASS = 'fore:yellow,bold' +lexers.STYLE_COMMENT = 'fore:blue,bold' +lexers.STYLE_CONSTANT = 'fore:cyan,bold' +lexers.STYLE_DEFINITION = 'fore:blue,bold' +lexers.STYLE_ERROR = 'fore:red,italics' +lexers.STYLE_FUNCTION = 'fore:blue,bold' +lexers.STYLE_HEADING = 'fore:magenta' +lexers.STYLE_KEYWORD = 'fore:yellow,bold' +lexers.STYLE_LABEL = 'fore:green,bold' +lexers.STYLE_NUMBER = 'fore:red,bold' +lexers.STYLE_OPERATOR = 'fore:cyan,bold' +lexers.STYLE_REGEX = 'fore:green,bold' +lexers.STYLE_STRING = 'fore:red,bold' +lexers.STYLE_PREPROCESSOR = 'fore:magenta,bold' +lexers.STYLE_TAG = 'fore:red,bold' +lexers.STYLE_TYPE = 'fore:green,bold' +lexers.STYLE_VARIABLE = 'fore:blue,bold' +lexers.STYLE_WHITESPACE = '' +lexers.STYLE_EMBEDDED = 'back:blue,bold' +lexers.STYLE_IDENTIFIER = '' + +lexers.STYLE_LINENUMBER = '' +lexers.STYLE_LINENUMBER_CURSOR = lexers.STYLE_LINENUMBER +lexers.STYLE_CURSOR = 'back:white,fore:black' +lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:yellow' +lexers.STYLE_CURSOR_LINE = 'underlined' +lexers.STYLE_COLOR_COLUMN = 'back:red' +lexers.STYLE_SELECTION = 'back:white,bold' +lexers.STYLE_STATUS = 'reverse' +lexers.STYLE_STATUS_FOCUSED = 'reverse,bold' +lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT +lexers.STYLE_INFO = 'bold' +lexers.STYLE_EOF = '' + +-- lexer specific styles + +-- Diff +lexers.STYLE_ADDITION = 'fore:green' +lexers.STYLE_DELETION = 'fore:red' +lexers.STYLE_CHANGE = 'fore:yellow' + +-- CSS +lexers.STYLE_PROPERTY = lexers.STYLE_ATTRIBUTE +lexers.STYLE_PSEUDOCLASS = '' +lexers.STYLE_PSEUDOELEMENT = '' + +-- HTML +lexers.STYLE_TAG_UNKNOWN = lexers.STYLE_TAG .. ',italics' +lexers.STYLE_ATTRIBUTE_UNKNOWN = lexers.STYLE_ATTRIBUTE .. ',italics' + +-- Latex, TeX, and Texinfo +lexers.STYLE_COMMAND = lexers.STYLE_KEYWORD +lexers.STYLE_COMMAND_SECTION = lexers.STYLE_CLASS +lexers.STYLE_ENVIRONMENT = lexers.STYLE_TYPE +lexers.STYLE_ENVIRONMENT_MATH = lexers.STYLE_NUMBER + +-- Makefile +lexers.STYLE_TARGET = '' + +-- Markdown +lexers.STYLE_HR = '' +for i = 1,6 do lexers['STYLE_HEADING_H'..i] = lexers.STYLE_HEADING end +lexers.STYLE_BOLD = 'bold' +lexers.STYLE_ITALIC = 'italics' +lexers.STYLE_LIST = lexers.STYLE_KEYWORD +lexers.STYLE_LINK = lexers.STYLE_KEYWORD +lexers.STYLE_REFERENCE = lexers.STYLE_KEYWORD + +-- Output +lexers.STYE_FILENAME = '' +lexers.STYLE_LINE = '' +lexers.STYLE_COLUMN = '' +lexers.STYLE_MESSAGE = '' + +-- Python +lexers.STYLE_KEYWORD_SOFT = '' + +-- Taskpaper +lexers.STYLE_NOTE = '' +lexers.STYLE_TAG_EXTENDED = '' +lexers.STYLE_TAG_DAY = 'fore:yellow' +lexers.STYLE_TAG_OVERDUE = 'fore:red' +lexers.STYLE_TAG_PLAIN = '' + +-- XML +lexers.STYLE_CDATA = '' + +-- YAML +lexers.STYLE_ERROR_INDENT = 'back:red' + +-- The following are temporary styles until their legacy lexers are migrated. + +-- Antlr +lexers.STYLE_ACTION = '' + +-- Clojure +lexers.STYLE_CLOJURE_KEYWORD = lexers.STYLE_TYPE +lexers.STYLE_CLOJURE_SYMBOL = lexers.STYLE_TYPE .. ',bold' + +-- Crystal +--lexers.STYLE_SYMBOL = lexers.STYLE_STRING + +-- Gleam +lexers.STYLE_MODULE = lexers.STYLE_CONSTANT +lexers.STYLE_DISCARD = lexers.STYLE_COMMENT + +-- Icon +lexers.STYLE_SPECIAL_KEYWORD = lexers.STYLE_TYPE + +-- jq +lexers.STYLE_FORMAT = lexers.STYLE_CONSTANT +lexers.STYLE_SYSVAR = lexers.STYLE_CONSTANT .. ',bold' + +-- Julia +-- lexers.STYLE_SYMBOL = lexers.STYLE_STRING +lexers.STYLE_CHARACTER = lexers.STYLE_CONSTANT + +-- Mediawiki +lexers.STYLE_BEHAVIOR_SWITCH = lexers.STYLE_KEYWORD + +-- Moonscript +lexers.STYLE_TBL_KEY = lexers.STYLE_REGEX +lexers.STYLE_SELF_REF = lexers.STYLE_LABEL +lexers.STYLE_PROPER_IDENT = lexers.STYLE_CLASS +lexers.STYLE_FNDEF = lexers.STYLE_PREPROCESSOR +-- lexers.STYLE_SYMBOL = lexers.STYLE_EMBEDDED + +-- reST +lexers.STYLE_LITERAL_BLOCK = lexers.STYLE_EMBEDDED +lexers.STYLE_FOOTNOTE_BLOCK = lexers.STYLE_LABEL +lexers.STYLE_CITATION_BLOCK = lexers.STYLE_LABEL +lexers.STYLE_LINK_BLOCK = lexers.STYLE_LABEL +lexers.STYLE_CODE_BLOCK = lexers.STYLE_EMBEDDED +lexers.STYLE_DIRECTIVE = lexers.STYLE_KEYWORD +lexers.STYLE_SPHINX_DIRECTIVE = lexers.STYLE_KEYWORD +lexers.STYLE_UNKNOWN_DIRECTIVE = lexers.STYLE_KEYWORD +lexers.STYLE_SUBSTITUTION = lexers.STYLE_VARIABLE +lexers.STYLE_INLINE_LITERAL = lexers.STYLE_EMBEDDED +lexers.STYLE_ROLE = lexers.STYLE_CLASS +lexers.STYLE_INTERPRETED = lexers.STYLE_STRING + +-- txt2tags +lexers.STYLE_LINE = 'bold' +for i = 1,5 do lexers['STYLE_H'..i] = lexers.STYLE_HEADING end +lexers.STYLE_IMAGE = 'fore:green' +lexers.STYLE_STRIKE = 'italics' +lexers.STYLE_TAGGED = lexers.STYLE_EMBEDDED +lexers.STYLE_TAGGED_AREA = lexers.STYLE_EMBEDDED +lexers.STYLE_TABLE_SEP = 'fore:green' +lexers.STYLE_HEADER_CELL_CONTENT = 'fore:green' diff --git a/files/.config/vis/visrc.lua b/files/.config/vis/visrc.lua new file mode 100644 index 0000000..7260419 --- /dev/null +++ b/files/.config/vis/visrc.lua @@ -0,0 +1,15 @@ +require("vis") + +vis.events.subscribe(vis.events.INIT, function() + vis:command("set theme kento2") + + vis:command("map! normal n ") + vis:map(vis.modes.VISUAL, ' y', '"+y') + vis:map(vis.modes.VISUAL, ' p', '"+p') + vis:map(vis.modes.VISUAL, ' d', '"+d') + vis:map(vis.modes.VISUAL, ' x', '"+x') + vis:map(vis.modes.NORMAL, ' y', '"+y') + vis:map(vis.modes.NORMAL, ' p', '"+p') + vis:map(vis.modes.NORMAL, ' d', '"+d') + vis:map(vis.modes.NORMAL, ' x', '"+x') +end) diff --git a/files/.local/bin/journal b/files/.local/bin/journal index 2b91f6b..edb7131 100755 --- a/files/.local/bin/journal +++ b/files/.local/bin/journal @@ -6,6 +6,6 @@ tmp="$(mktemp /tmp/journal.XXXXXX)" d="$(date -I)" grep "$d" "$JOURNAL" || printf "%s\n" "$d" > "$tmp" -nvi "$tmp" +"${EDITOR:-vi}" "$tmp" tail "$JOURNAL" (printf "\n"; cat "$tmp" | tee -a "$JOURNAL") && rm "$tmp" diff --git a/files/.velox.conf b/files/.velox.conf deleted file mode 100644 index de411a1..0000000 --- a/files/.velox.conf +++ /dev/null @@ -1,85 +0,0 @@ -# velox.conf - -# property value -set mod logo -#set window.border_color_active 0x888888ff -#set window.border_color_inactive 0xffffffff -set window.border_width 2 - -set tap_to_click 1 - -set tag.1.name 1 -set tag.2.name 2 -set tag.3.name 3 -set tag.4.name 4 -set tag.5.name 5 -set tag.6.name 6 -set tag.7.name 7 -set tag.8.name 8 -set tag.9.name 9 - -# name type arguments -action spawn_terminal spawn exec lxterminal -action spawn_run spawn exec lxterminal -e menu -action spawn_browser spawn exec luakit -action tty_1 spawn doas chvt 1 -action tty_2 spawn doas chvt 2 -action tty_3 spawn doas chvt 3 - -# key modifiers action -key F1 alt tty_1 -key F2 alt tty_2 -key F3 alt tty_3 -key j mod focus_next -key k mod focus_prev -key Return mod zoom -key space mod layout_next -key Tab mod previous_tags -key q mod,shift quit - -key g mod window.switch_layer -key d mod,shift window.close - -key h mod tall.decrease_master_size -key l mod tall.increase_master_size -key h mod,shift tall.increase_num_masters -key l mod,shift tall.decrease_num_masters -key h mod,ctrl tall.increase_num_columns -key l mod,ctrl tall.decrease_num_columns - -key Return mod,shift spawn_terminal -key d mod spawn_run -key s mod,shift spawn_browser - -key 1 mod tag.1.activate -key 2 mod tag.2.activate -key 3 mod tag.3.activate -key 4 mod tag.4.activate -key 5 mod tag.5.activate -key 6 mod tag.6.activate -key 7 mod tag.7.activate -key 8 mod tag.8.activate -key 9 mod tag.9.activate - -key 1 mod,ctrl tag.1.toggle -key 2 mod,ctrl tag.2.toggle -key 3 mod,ctrl tag.3.toggle -key 4 mod,ctrl tag.4.toggle -key 5 mod,ctrl tag.5.toggle -key 6 mod,ctrl tag.6.toggle -key 7 mod,ctrl tag.7.toggle -key 8 mod,ctrl tag.8.toggle -key 9 mod,ctrl tag.9.toggle - -key 1 mod,shift tag.1.apply -key 2 mod,shift tag.2.apply -key 3 mod,shift tag.3.apply -key 4 mod,shift tag.4.apply -key 5 mod,shift tag.5.apply -key 6 mod,shift tag.6.apply -key 7 mod,shift tag.7.apply -key 8 mod,shift tag.8.apply -key 9 mod,shift tag.9.apply - -button left mod window.begin_move:window.end_move -button left mod,shift window.begin_resize:window.end_resize diff --git a/files/.xinitrc b/files/.xinitrc index ce24f37..a74d308 100644 --- a/files/.xinitrc +++ b/files/.xinitrc @@ -1,4 +1,4 @@ -sct 4000 & +sct 3500 & setxkbmap de & -xsetroot -solid '#101020' & -exec dbus-run-session dk +xsetroot -solid gray70 & +exec dbus-run-session dk \ No newline at end of file diff --git a/files/.zprofile b/files/.zprofile index 951c9a5..d0ecf9f 100644 --- a/files/.zprofile +++ b/files/.zprofile @@ -4,6 +4,8 @@ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig export XKB_DEFAULT_LAYOUT=de export XBPS_DISTDIR="$HOME/void-packages" +export EDITOR=/usr/bin/vis + exists() { which "$1" >/dev/null 2>&1 } diff --git a/files/.zshrc b/files/.zshrc index c332a4a..170e3de 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -14,6 +14,8 @@ l() { find ${2:-.} ! -type d | sed 's:^\./::' | egrep "$1" } sprunge() { cat $@ | curl -sF 'sprunge=<-' http://sprunge.us } alias xi='xi -y' +alias vi='vis' +alias nvi='vis' alias xr='doas xbps-remove -y' date diff --git a/pkgs.txt b/pkgs.txt index 4538a5b..955af5d 100644 --- a/pkgs.txt +++ b/pkgs.txt @@ -1,5 +1,4 @@ -alsa-tools -alsa-utils +alsa-pipewire base-system cage chrony @@ -25,6 +24,8 @@ lxterminal man-pages-devel man-pages-posix opendoas +playerctl +pipewire ripgrep sct scrot @@ -33,6 +34,7 @@ socklog-void surf terminus-font turnstile +vis void-docs-browse xorg xclip