-# tint2 config
-etc/tint2/tint2rc.backup.*
-
-# sway site-local configs
-etc/sway/config.d
-
# vim
-base/.vim/.netrwhist
+/etc/vim/.netrwhist
*.swp
*.swo
[submodule "todo.txt-vim"]
- path = base/.vim/pack/todo.txt/start/todo.txt-vim
+ path = etc/vim/pack/todo.txt-vim/start/todo.txt-vim
url = https://github.com/freitass/todo.txt-vim
[submodule "vim-surround"]
- path = base/.vim/pack/surround.vim/start/vim-surround
+ path = etc/vim/pack/vim-surround/start/vim-surround
url = https://github.com/tpope/vim-surround
[submodule "vim-commentary"]
- path = base/.vim/pack/commentary.vim/start/vim-commentary
+ path = etc/vim/pack/vim-commentary/start/vim-commentary
url = https://github.com/tpope/vim-commentary
[submodule "vim-speeddating"]
- path = base/.vim/pack/speeddating.vim/start/vim-speeddating
+ path = etc/vim/pack/vim-speeddating/start/vim-speeddating
url = https://github.com/tpope/vim-speeddating
[submodule "vim-repeat"]
- path = base/.vim/pack/repeat.vim/start/vim-repeat
+ path = etc/vim/pack/vim-repeat/start/vim-repeat
url = https://github.com/tpope/vim-repeat
-[submodule "paper-icon-theme"]
- path = gui/icons/paper-icon-theme
- url = https://github.com/snwh/paper-icon-theme
-[submodule "Blackbird"]
- path = gui/themes/Blackbird
- url = https://github.com/shimmerproject/Blackbird
+[submodule "editorconfig-vim"]
+ path = etc/vim/pack/editorconfig-vim/start/editorconfig-vim
+ url = https://github.com/editorconfig/editorconfig-vim.git
+++ /dev/null
-! fonts
-! X11 font server fontspec
-*font: -windows-dina-medium-r-*-*-10-80-*-*-*-*-*
-! xft/fontconfig
-! NOTE: xterm etc. use faceName for Xft fonts. classic font server rendering is
-! preferred so this is just in case the program doesn't support PCF.
-*faceName: Dina
-*faceSize: 8
-! matches font.conf, just in case
-Xft.antialias: 1
-Xft.rgba: rgb
-Xft.hinting: 1
-Xft.hintstyle: hintslight
-
-! theming
-Xcursor.theme: Paper
-
-! colors
-*background: #010812
-*foreground: #798699
-*fading: 40
-*fadeColor: #820ad5
-*cursorColor: #6408a4
-*pointerColorBackground: #6408a4
-*pointerColorForeground: #191c21
-*underlineColor: #d5820a
-! black/grey
-*color0: #191c21
-*color8: #3b434e
-! red
-*color1: #d51d0a
-*color9: #f4321e
-! green
-*color2: #5dd50a
-*color10: #75f41e
-! yellow
-*color3: #d5820a
-*color11: #f49d1e
-! blue
-*color4: #0a5dd5
-*color12: #1e75f4
-! magenta
-*color5: #820ad5
-*color13: #9d1ef4
-! cyan
-*color6: #0ac2d5
-*color14: #1ee0f4
-! light grey/white
-*color7: #bcc2cc
-*color15: #e8ebee
+++ /dev/null
-use_colors = ON
-use_shadow = ON
-screen_color = (BLUE,BLACK,ON)
-dialog_color = (WHITE,BLACK,OFF)
-shadow_color = (BLACK,BLACK,OFF)
-title_color = screen_color
-border_color = (WHITE,BLACK,ON)
-button_inactive_color = border_color
-button_key_inactive_color = (BLUE,BLACK,ON)
-button_label_inactive_color = button_inactive_color
-button_active_color = (WHITE,BLUE,ON)
-button_key_active_color = button_key_inactive_color
-button_label_active_color = (WHITE,BLUE,ON)
-inputbox_color = dialog_color
-inputbox_border_color = dialog_color
-searchbox_color = dialog_color
-searchbox_title_color = title_color
-searchbox_border_color = border_color
-position_indicator_color = title_color
-menubox_color = dialog_color
-menubox_border_color = border_color
-item_color = dialog_color
-item_selected_color = button_active_color
-tag_color = title_color
-tag_selected_color = button_label_active_color
-tag_key_color = button_key_inactive_color
-tag_key_selected_color = (BLACK,BLUE,ON)
-check_color = dialog_color
-check_selected_color = button_active_color
-uarrow_color = (GREEN,BLACK,ON)
-darrow_color = uarrow_color
-itemhelp_color = (WHITE,BLACK,OFF)
-form_active_text_color = button_active_color
-form_text_color = border_color
-form_item_readonly_color = (BLACK,WHITE,ON)
-gauge_color = title_color
-border2_color = dialog_color
-inputbox_border2_color = dialog_color
-searchbox_border2_color = dialog_color
-menubox_border2_color = dialog_color
+++ /dev/null
-gtk-font-name="monospace-10"
-gtk-theme-name="Blackbird"
-gtk-icon-theme-name="Paper-Mono-Dark"
-gtk-cursor-theme-name="Paper"
-gtk-cursor-theme-size="24"
+++ /dev/null
-def clear():
- import os
- os.system('clear')
+++ /dev/null
-Subproject commit 627308e30639be3e2d5402808ce18690557e8292
+++ /dev/null
-Subproject commit 95da3d72efc91a5131acf388eafa4b1ad6512a9b
+++ /dev/null
-Subproject commit baf89ad26488f6a7665d51b986f5c7ad2d22b30b
+++ /dev/null
-" Modeliner
-"
-" Version: 0.3.0
-" Description:
-"
-" Generates a modeline from current settings.
-"
-" Last Change: 27-Jun-2008.
-" Maintainer: Shuhei Kubota <chimachima@gmail.com>
-"
-" Usage:
-" execute ':Modeliner'.
-" Then a modeline is generated.
-"
-" The modeline will either be appended next to the current line or replace
-" the existing one.
-"
-" If you want to customize option, modify g:Modeliner_format.
-
-if !exists('g:Modeliner_format')
- let g:Modeliner_format = 'et ff= fenc= sts= sw= ts='
- " /[ ,:]/ delimited.
- "
- " if the type of a option is NOT 'boolean' (see :help 'option-name'),
- " append '=' to the end of each option.
-endif
-
-
-"[text] vi: tw=80 noai
-"[text] vim:tw=80 noai
-" ex:tw=80 : noai:
-"
-"[text] vim: set tw=80 noai:[text]
-"[text] vim: se tw=80 noai:[text]
-"[text] vim:set tw=80 noai:[text]
-" vim: set tw=80 noai: [text]
-" vim:se tw=80 noai:
-
-
-command! Modeliner call <SID>Modeliner_execute()
-
-
-" to retrieve the position
-let s:Modeline_SEARCH_PATTERN = '\svi:\|vim:\|ex:'
-" to extract options from existing modeline
-let s:Modeline_EXTRACT_PATTERN = '\v(.*)\s+(vi|vim|ex):\s*(set?\s+)?(.+)' " very magic
-" first form
-"let s:Modeline_EXTRACT_OPTPATTERN1 = '\v(.+)' " very magic
-" second form
-let s:Modeline_EXTRACT_OPTPATTERN2 = '\v(.+):(.*)' " very magic
-
-
-function! s:Modeliner_execute()
- let options = []
-
- " find existing modeline, and determine the insert position
- let info = s:SearchExistingModeline()
-
- " parse g:Modeliner_format and join options with them
- let extractedOptStr = g:Modeliner_format . ' ' . info.optStr
- let extractedOptStr = substitute(extractedOptStr, '[ ,:]\+', ' ', 'g')
- let extractedOptStr = substitute(extractedOptStr, '=\S*', '=', 'g')
- let extractedOptStr = substitute(extractedOptStr, 'no\(.\+\)', '\1', 'g')
- let opts = sort(split(extractedOptStr))
- "echom 'opt(list): ' . join(opts, ', ')
-
- let optStr = ''
- let prevO = ''
- for o in opts
- if o == prevO | continue | endif
- let prevO = o
-
- if stridx(o, '=') != -1
- " let optExpr = 'ts=' . &ts
- execute 'let optExpr = "' . o . '" . &' . strpart(o, 0, strlen(o) - 1)
- else
- " let optExpr = (&et ? '' : 'no') . 'et'
- execute 'let optExpr = (&' . o . '? "" : "no") . "' . o . '"'
- endif
-
- let optStr = optStr . ' ' . optExpr
- endfor
-
- if info.lineNum == 0
- let modeline = s:Commentify(optStr)
- else
- let modeline = info.firstText . ' vim: set' . optStr . ' :' . info.lastText
- endif
-
-
- " insert new modeline
- if info.lineNum != 0
- "modeline FOUND -> replace the modeline
-
- "show the existing modeline
- let orgLine = line('.')
- let orgCol = col('.')
- call cursor(info.lineNum, 1)
- normal V
- redraw
-
- "confirm
- "if confirm('Are you sure to overwrite this existing modeline?', "&Yes\n&No", 1) == 1
- echo 'Are you sure to overwrite this existing modeline? [y/N]'
- if char2nr(tolower(nr2char(getchar()))) == char2nr('y')
- call setline(info.lineNum, modeline)
-
- "show the modeline being changed
- if (info.lineNum != line('.')) && (info.lineNum != line('.') + 1)
- redraw
- sleep 1
- endif
- endif
-
- "back to the previous position
- echo
- execute "normal \<ESC>"
- call cursor(orgLine, orgCol)
- else
- "modeline NOT found -> append new modeline
- call append('.', modeline)
- endif
-
-endfunction
-
-
-function! s:Commentify(s)
- if exists('g:NERDMapleader') " NERDCommenter
- let result = b:left . ' vim: set' . a:s . ' : ' . b:right
- else
- let result = substitute(&commentstring, '%s', ' vim: set' . a:s . ' : ', '')
- endif
-
- return result
-endfunction
-
-
-function! s:SearchExistingModeline()
- let info = {'lineNum':0, 'text':'', 'firstText':'', 'lastText':'', 'optStr':''}
-
- let candidates = []
-
- " cursor position?
- call add(candidates, line('.'))
- " user may position the cursor to previous line...
- call add(candidates, line('.') + 1)
- let cnt = 0
- while cnt < &modelines
- " header?
- call add(candidates, cnt + 1)
- " footer?
- call add(candidates, line('$') - cnt)
- let cnt = cnt + 1
- endwhile
-
- " search
- for i in candidates
- let lineNum = i
- let text = getline(lineNum)
-
- if match(text, s:Modeline_SEARCH_PATTERN) != -1
- let info.lineNum = lineNum
- let info.text = text
- break
- endif
- endfor
-
- " extract texts
- if info.lineNum != 0
- "echom 'modeline: ' info.lineNum . ' ' . info.text
-
- let info.firstText = substitute(info.text, s:Modeline_EXTRACT_PATTERN, '\1', '')
-
- let isSecondForm = (strlen(substitute(info.text, s:Modeline_EXTRACT_PATTERN, '\3', '')) != 0)
- "echom 'form : ' . string(isSecondForm + 1)
- if isSecondForm == 0
- let info.lastText = ''
- let info.optStr = substitute(info.text, s:Modeline_EXTRACT_PATTERN, '\4', '')
- else
- let info.lastText = substitute(
- \ substitute(info.text, s:Modeline_EXTRACT_PATTERN, '\4', ''),
- \ s:Modeline_EXTRACT_OPTPATTERN2,
- \ '\2',
- \ '')
- let info.optStr = substitute(
- \ substitute(info.text, s:Modeline_EXTRACT_PATTERN, '\4', ''),
- \ s:Modeline_EXTRACT_OPTPATTERN2,
- \ '\1',
- \ '')
- endif
- endif
-
- "echom 'firstText: ' . info.firstText
- "echom 'lastText: ' . info.lastText
- "echom 'optStr: ' . info.optStr
-
- return info
-endfunction
-
-
-function! s:ExtractOptionStringFromModeline(text)
- let info = {}
-
- let info.firstText = substitute(a:text, s:Modeline_EXTRACT_PATTERN, '\1', '')
-
- let isSecondForm = (strlen(substitute(a:text, s:Modeline_EXTRACT_PATTERN, '\3', '') != 0)
- if isSecondForm == 0
- let info.lastText = ''
- let info.optStr = substitute(a:text, s:Modeline_EXTRACT_PATTERN, '\2', '')
- else
- let info.lastText = substitute(
- \ substitute(a:text, s:Modeline_EXTRACT_PATTERN, '\4', ''),
- \ s:Modeline_EXTRACT_OPTPATTERN2,
- \ '\2',
- \ '')
- let info.optStr = substitute(
- \ substitute(a:text, s:Modeline_EXTRACT_PATTERN, '\4', ''),
- \ s:Modeline_EXTRACT_OPTPATTERN2,
- \ '\1',
- \ '')
- endif
-
- return info
-endfunction
-
-" vim: set et fenc=utf-8 ff=unix sts=4 sw=4 ts=4 :
+export ZDOTDIR=${XDG_CONFIG_HOME:-~/.config}/zsh
+
### load site-specific
-[[ -f ~/.zshenv.local ]] && source ~/.zshenv.local
+[[ -f ${ZDOTDIR:-~}/.zshenv.local ]] && source ${ZDOTDIR:-~}/.zshenv.local
### fix broken term
+if [[ ! -v TERM ]] {
+ TERM=xterm-256color >/dev/null 2>&1
+}
if [[ -o interactive && $#terminfo -eq 0 ]] {
_oldterm=$TERM
- TERM=xterm-256color >/dev/null 2>&1
+ export TERM=xterm >/dev/null 2>&1
print -P "%F{red}!!! Can't find terminfo for $_oldterm, using $TERM%f"
unset _oldterm
}
if [[ -o login ]] {
### cd on login shell for convenience
+ # NOTE: we do this here and not in .zprofile since we occasionally might
+ # re-source .zprofile, and it's easier to just put the logic here...
cd ~
} else {
if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] {
- # this is to allow gpg and pinentry env to be updated
+ ### update gpgagent to use graphical pinentry
# XXX: will be sourced by every new child shell if zsh is not used to
- # start the graphical session, but since .zprofile is light that
- # shouldn't cause a noticeable performance impact
- # NOTE: above happens with sway without a display manager or launcher
+ # start the graphical session and the _sev_first_disaply var isn't
+ # exported; for example, this happens with sway without a display
+ # manager or launcher in front of it
export _sev_first_display=
- source ${ZDOTDIR:-~}/.zprofile
- export _sev_first_display=0
+ _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile
} elif [[ $SHLVL == 1 ]] {
- ### early zprofile sourcing for first shell
+ ### early zprofile sourcing for first shell even if not a login shell
# NOTE: ensure profile is loaded for toplevel shells; should hopefully be 1
# under some Xorg or cron implementations, which is where this would be most useful
source ${ZDOTDIR:-~}/.zprofile
+++ /dev/null
-#!/bin/sh
-first=true
-i3subscribe mode | while read -r x; do
- if $first; then
- first=false
- x=default #XXX: i3 does not expose method to get mode, assume
- fi
- x=${x#mode:}
- [ "$1" = "hide-default" -a "$x" = "default" ] && echo || echo "$x"
-done
+++ /dev/null
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use Text::Template 'fill_in_string';
-use AnyEvent::I3;
-use v5.10;
-
-my $i3 = i3();
-$i3->connect->recv or die "Error connecting to i3";
-
-my ($ev, $str) = @ARGV;
-if (not defined $str) {
- die "Error: Too few arguments\n" .
- "Usage: $0 workspace|output|mode|window|barconfig_update|binding format_string\n" .
- "Example: $0 window 'The window title is {\$name}'"
-}
-
-$i3->subscribe({
- $ev => sub {
- # XXX: there has to be a way to make this one line
- my ($msg) = @_;
- # XXX: not escaped
- say Text::Template::fill_in_string($str, HASH=>$msg->{'container'});
- }
-})->recv;
-
-AE::cv->recv;
-
-# vim: et:ts=4:sts=4:sw=4
+++ /dev/null
-#!/usr/bin/env perl
-
-BEGIN { $| = 1 } # flush \n
-
-use strict;
-use warnings;
-use Data::Dumper;
-use AnyEvent::I3;
-use v5.10;
-
-my $i3 = i3();
-$i3->connect->recv or die "Error connecting to i3";
-
-sub subscribe {
- my $ev = $_[0];
- my $dump = $_[1];
- if($i3->subscribe({
- $ev => sub {
- my ($msg) = @_;
- say "$ev:$msg->{'change'}";
- if($dump) {
- print Dumper($msg);
- }
- }
- })->recv->{success}) {
- say "Successfully subscribed to $ev event";
- }
-}
-
-my $nextArg = shift;
-if(!$nextArg) {
- say "Subscribe to i3 events";
- say "Usage: $0 workspace|output|mode|window|barconfig_update|binding [dump]";
- say "Example: $0 workspace dump window binding dump";
- exit 1;
-}
-while($nextArg) {
- my $arg = $nextArg;
- $nextArg = shift;
- my $dump = 0;
- if($nextArg and $nextArg eq "dump") {
- $dump = 1;
- $nextArg = shift;
- }
- subscribe("$arg", $dump);
-}
-AE::cv->recv;
-
-# vim: et:ts=4:sts=4
+++ /dev/null
-#!/bin/sh
-
-# term lock
-if [ -z "$DISPLAY" ]; then
- if [ "$OSTYPE" = "freebsd" ]; then
- lock -npv
- else
- lock -np
- fi
- exit
-fi
-
-# xorg lock
-img=~/tmp/lock.png
-if [ -f "$img" ]; then
- # rudimentary attempt to prevent multiple locks
- # XXX: could block lock and replace with malicious locker to grab password
- echo "Lock file exists at '$img', exiting"
- exit 1
-fi
-res="$(xdpyinfo | grep dimensions | awk '{print $2}')"
-scale=0.07
-ffmpeg -y -loglevel 0 \
- -s "$res" -f x11grab -i $DISPLAY -i ~/share/lck/overlay.png \
- -filter_complex "
- [0]
- scale=iw * $scale:ih * $scale,
- noise=alls=2,
- scale=`echo $res | tr x :`:flags=neighbor,
- noise=alls=5,
- gblur=8
- [composite];
- [composite]
- [1] overlay=x=(main_w - overlay_w) / 2 + 0.5:
- y=(main_h - overlay_h) / 2
- [out]" \
- -map "[out]" -vframes 1 "$img"
-# pause dunst
-pkill -USR1 dunst
-i3lock -nefi "$img"
-rm "$img"
-pkill -USR2 dunst
+++ /dev/null
-#!/bin/sh
-#TODO: help
-mpc=mpc
-dest=org.freedesktop.Notifications
-opath=/org/freedesktop/Notifications
-meth=$dest.Notify
-idfile=~/tmp/mpc-notify.id
-
-notify() {
- replaces_id=0
- if [ -e $idfile ]; then
- replaces_id=`cat $idfile`
- fi
- echo $(expr "$(gdbus call --session \
- --dest $dest --object-path $opath --method $meth \
- mpc $replaces_id audio-volume-high "${1:-$out1}" "${2:-$out2}" '[]' \
- '{"urgency": <byte 0>}' 3000)" : '(uint32 \([0-9]*\),)') > $idfile
-}
-
-getoutput() {
- #TODO test if not playing for some commands
- #if mpc -f '' status | awk 'NR==2' | grep -v '^\[playing\]'; then
- case "$1" in
- current)
- out1=`$mpc -f %artist% current`
- out2="`$mpc -f %title% current`\n`mpc -f %album% current`";;
- status) out1=`$mpc current`
- out2=`$mpc -f '%album% (%date%)' status`;;
- *) return 1;;
- esac
- if [ -z "$out1$out2" ]; then
- out1='Stopped'
- fi
-}
-
-cmd=${1:-current}
-case "$cmd" in
- -d|--daemon|idle|idleloop)
- cmd=${2:-current}
- $mpc idleloop player | while read -r x; do
- getoutput $cmd
- notify "$out1" "$out2"
- done
- return;;
- *) getoutput $cmd || return 1;;
-esac
-notify "$out1" "$out2"
+++ /dev/null
-#!/bin/sh
-pkill redshift > /dev/null 2>&1
-redshift -m randr -x
+++ /dev/null
-#!/bin/sh
-pkill redshift > /dev/null 2>&1
-redshift -l manual:lat=38:lon=-92 -m randr -t 6600:4000 -r &
+++ /dev/null
-#!/bin/sh
-
-default_output=LVDS1
-
-usage() {
- echo "Usage:
- rotate (left|right|invert) [output]
- rotate set (normal|right|inverted|left) [output]
-Examples:
- rotate left LVDS1
- rotate set right HDMI2
-
-Only the first letter of each command is checked (case-insensitive), so they
-can be abbreviated or even cut to one letter each in lower or upper case.
-
-For example, the following commands do the same thing:
- rotate set left
- rotate SET LeFt
- rotate s l
- rotate salad lasagna"
-}
-
-rot_to_num() {
- case $1 in
- # normal right invert left
- # convert to numbers to allow math to rotate
- [nN]*) rot0=0;;
- [rR]*) rot0=1;;
- [iI]*) rot0=2;;
- [lL]*) rot0=3;;
- *) usage; exit 2;;
- esac
-}
-num_to_rot() {
- case $1 in
- # maps to rot_to_num output
- 0) rot1=normal
- rot2=none;;
- 1) rot1=right
- rot2=cw;;
- 2) rot1=inverted
- rot2=half;;
- 3) rot1=left
- rot2=ccw;;
- esac
-}
-
-case $1 in
- [sS]*)
- # set: rotate set (normal|right|inverted|left) [output]
- output=${3:-$default_output}
- rot_to_num $2
- ;;
- *)
- # rotate (left|right|invert) [output]
- output=${2:-$default_output}
- rot_to_num `xrandr --query --verbose | grep $output | awk '{print $5}'`
- case $1 in
- [lL]*) rot0=$(($rot0 - 1));;
- [rR]*) rot0=$(($rot0 + 1));;
- [iI]*) rot0=$(($rot0 + 2));;
- *) usage; exit 1;;
- esac
- ;;
-esac
-
-# add 4 modulo 4 to prevent negatives and overflows
-num_to_rot $((($rot0 + 4) % 4))
-
-xrandr --output $output --rotation $rot1
-# x220t
-if command -v xsetwacom >/dev/null 2>&1; then
- xsetwacom --set stylus Rotate $rot2
- xsetwacom --set eraser Rotate $rot2
- xsetwacom --set touch Rotate $rot2
-fi
-
-# reload bg
-~/bin/wall
#!/bin/sh
-cpanm --local-lib=$XDG_DATA_HOME/perl5 local::lib
+cpanm --local-lib=${XDG_DATA_HOME:-~/share}/perl5 local::lib
+++ /dev/null
-#!/bin/sh
-base=~/.icons/Paper-Mono-Dark/24x24/panel/audio-volume
- high=$base-high.svg
-medium=$base-medium.svg
- low=$base-low.svg
- muted=$base-muted.svg
-
-# TODO: doesn't work if no master mixer, eg usb dac
-ident="iface=MIXER,name=Master Playback Volume"
-eval $(amixer cget "$ident" | grep -o 'max=\d\+')
-
-while true; do
- # XXX: assume mono, could be different
- vol=$(amixer get Master | grep 'Mono:')
- mute=$(echo "$vol" | cut -d ' ' -f 8)
- vol=$(expr $(echo "$vol" | cut -d ' ' -f 5) \* 100 / $max \* 100 / 100)
- if [ $mute = '[off]' ]; then
- echo $muted
- elif [ $vol -ge 75 ]; then
- echo $high
- elif [ $vol -ge 50 ]; then
- echo $medium
- elif [ $vol -ge 25 ]; then
- echo $low
- else
- echo $muted
- fi
- sleep 2
-done
+++ /dev/null
-#!/bin/sh
-. ~/bin/.check-busybox
-u=-u
-check-busybox sed && u=''
-i3status -c ${XDG_CONFIG_HOME:-~/.config}/i3status/tint2-$1 | sed $u -e 's/fc=\(#[a-f0-9]\{3,6\}\)/span color="\1"/gi;s_/fc_/span_g'
-unset check-busybox
+++ /dev/null
-#!/bin/sh
-base=~/.icons/Paper-Mono-Dark/24x24/panel/network-wireless
-excellent=$base-signal-excellent.svg
- good=$base-signal-good.svg
- ok=$base-signal-ok.svg
- low=$base-signal-low.svg
- none=$base-signal-none.svg
- no_route=$base-no-route.svg
- offline=$base-offline.svg
-
-echo $base-acquiring.svg
-while true; do
- x=$(cat /proc/net/wireless | awk 'NR < 3 {next} {printf "%.0f", $4}')
- if [ -z $x ]; then
- echo $offline
- elif [ $x -ge -55 ]; then
- echo $excellent
- elif [ $x -ge -65 ]; then
- echo $good
- elif [ $x -ge -75 ]; then
- echo $ok
- elif [ $x -ge -85 ]; then
- echo $low
- elif [ $x -ge -90 ]; then
- echo $none
- else
- echo $no_route
- fi
- sleep 2
-done
+++ /dev/null
-#!/bin/sh
-wall="$HOME/var/tmp/wall.jpg"
-res=$(xdpyinfo)
-if [ $? -eq 0 ]; then
- res=$(echo "$res" | awk '/dimensions:/{print $2}')
-else
- echo "ERROR: $res"
- exit 1
-fi
-wget -O "$wall" "https://source.unsplash.com/$res/?tunnel,architecture" && feh --no-fehbg --bg-fill "$wall"
+++ /dev/null
-[Qt]
-style=GTK+
+++ /dev/null
-[general]
-framerate = 24
-autosens = 0
-sensitivity = 300
-bar_width = 1
-bar_spacing = 2
-
-[input]
-method = fifo
-source = /var/mpd/fifo
-
-[output]
-channels = stereo
-
-[color]
-; background = black
-foreground = 'yellow'
-
-[smoothing]
-integral = 0
-monstercat = 0
-gravity = 85
+++ /dev/null
-# Shadow
-shadow = true;
-no-dnd-shadow = true;
-no-dock-shadow = true;
-clear-shadow = true;
-shadow-radius = 8;
-shadow-offset-x = -12;
-shadow-offset-y = -12;
-shadow-opacity = 0.3;
-shadow-exclude = [
- # gtk3 fix
- "_GTK_FRAME_EXTENTS@:c",
- # i3 tabbed windows
- "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
- # i3 titlebar
- "class_g = 'i3-frame'",
- # fullscreen/dmenu
- "x = 0 && y = 0 && override_redirect = true",
- # bg terminals
- "class_i = 'TermBg1'",
- "class_i = 'TermBg2'"
-];
-shadow-ignore-shaped = true;
-
-# Opacity
-menu-opacity = 0.9;
-inactive-opacity = 0.875;
-active-opacity = 1;
-alpha-step = 0.01;
-inactive-dim = 0.075;
-# XXX: crashes on alpine???
-#blur-background = true;
-blur-kern = "5,5,0.367879,0.535261,0.606531,0.535261,0.367879,0.535261,0.778801,0.882497,0.778801,0.535261,0.606531,0.882497,0.882497,0.606531,0.535261,0.778801,0.882497,0.778801,0.535261,0.367879,0.535261,0.606531,0.535261,0.367879,"
-opacity-rule = [
- # i3 tabbed windows
- "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
-];
-blur-background-exclude = [
- # gtk3 fix
- "_GTK_FRAME_EXTENTS@:c",
- # i3 titlebar
- "class_g = 'i3-frame'",
- # ignore docks
- "window_type = 'dock'",
- "window_type = 'desktop'"
-];
-
-# Fading
-fading = true;
-fade-delta = 16;
-fade-in-step = 0.05;
-fade-out-step = 0.05;
-
-# Rendering
-backend = "glx"
-glx-no-stencil = true;
-glx-no-rebind-pixmap = true;
-paint-on-overlay = true;
-refresh-rate = 0;
-vsync = "opengl-swc";
-
-# Other
-mark-wmwin-focused = true;
-mark-ovredir-focused = true;
-use-ewmh-active-win = true;
-detect-rounded-corners = true;
-detect-client-opacity = true;
-detect-transient = true;
-detect-client-leader = true;
-
-# Window type settings
-wintypes:
-{
- tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true; };
-};
+++ /dev/null
-[global]
-geometry = "400x0-30-30"
-follow = keyboard
-sort = yes
-
-font = "monospace 9"
-markup = no
-format = "<b>%s</b> %p <span size='5120' color='#586e75'>%a</span>\n%b"
-show_age_threshold = 5
-
-frame_width = 1
-separator_height = 1
-separator_color = frame
-padding = 4
-horizontal_padding = 4
-icon_position = left
-# {~/.icons,/usr/share/icons,/usr/share/local/icons}/*/16x16/*
-icon_path = "~/.icons/Paper/16x16/actions:~/.icons/Paper/16x16/apps:~/.icons/Paper/16x16/categories:~/.icons/Paper/16x16/devices:~/.icons/Paper/16x16/emblems:~/.icons/Paper/16x16/emotes:~/.icons/Paper/16x16/mimetypes:~/.icons/Paper/16x16/panel:~/.icons/Paper/16x16/places:~/.icons/Paper/16x16/status:~/.icons/Paper/16x16/web:/usr/share/icons/hicolor/16x16/actions:/usr/share/icons/hicolor/16x16/animations:/usr/share/icons/hicolor/16x16/apps:/usr/share/icons/hicolor/16x16/categories:/usr/share/icons/hicolor/16x16/devices:/usr/share/icons/hicolor/16x16/emblems:/usr/share/icons/hicolor/16x16/emotes:/usr/share/icons/hicolor/16x16/filesystems:/usr/share/icons/hicolor/16x16/intl:/usr/share/icons/hicolor/16x16/mimetypes:/usr/share/icons/hicolor/16x16/places:/usr/share/icons/hicolor/16x16/status:/usr/share/icons/hicolor/16x16/stock:/usr/share/icons/locolor/16x16/apps"
-
-dmenu = "~/bin/dmenu -p dunst:"
-browser = /usr/bin/firefox
-
-close = mod4+shift+grave
-#close_all = mod4+mod2+grave
-history = mod4+grave
-context = mod4+ctrl+grave
-
-[urgency_low]
-background = "#110800"
-foreground = "#93a1a1"
-frame_color = "#884400"
-timeout = 5
-
-[urgency_normal]
-background = "#221100"
-foreground = "#eee8d5"
-frame_color = "#268bd2"
-timeout = 10
-
-[urgency_critical]
-background = "#dc332f"
-foreground = "#000000"
-frame_color = "#ff4400"
-timeout = 0
-
-# vim: ft=cfg
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
- <description>set up render settings; aliases for Source, Dina</description>
-
- <!-- rgb pixel alignment -->
- <match target="font">
- <edit name="rgba" mode="assign">
- <const>rgb</const>
- </edit>
- </match>
- <!-- duplicate 20-hinting-slight.conf just in case -->
- <match target="pattern">
- <edit name="hintstyle" mode="append">
- <const>hintslight</const>
- </edit>
- </match>
-
- <!-- preface 60-generic.conf and prefer no color.
- this value is actually not that useful due to implementation detail...
- -->
- <match>
- <test name="lang">
- <string>und-zsye</string>
- </test>
- <test qual="all" name="color" compare="not_eq">
- <bool>true</bool>
- </test>
- <test qual="all" name="color" compare="not_eq">
- <bool>false</bool>
- </test>
- <edit name="color" mode="append">
- <bool>false</bool>
- </edit>
- </match>
+ <description>aliases for Source, Dina</description>
<!-- fuck helvetica -->
<match>
+++ /dev/null
-[Settings]
-gtk-font-name=monospace 10
-gtk-theme-name=Blackbird
-gtk-icon-theme-name=Paper-Mono-Dark
-gtk-application-prefer-dark-theme=true
-gtk-cursor-theme-name=Paper
-gtk-cursor-theme-size=24
-gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
-gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR
-gtk-button-images=1
-gtk-menu-images=1
-gtk-enable-event-sounds=1
-gtk-enable-input-feedback-sounds=1
-gtk-xft-antialias=1
-gtk-xft-hinting=1
-gtk-xft-hintstyle=hintslight
-gtk-xft-rgba=none
+++ /dev/null
-[Settings]
-gtk-font-name=monospace 10
-# TODO: Blackbird doesn't support gtk4
-#gtk-theme-name=Blackbird
-gtk-icon-theme-name=Paper-Mono-Dark
-gtk-application-prefer-dark-theme=true
-gtk-cursor-theme-name=Paper
-gtk-cursor-theme-size=24
-gtk-enable-event-sounds=1
-gtk-enable-input-feedback-sounds=1
-gtk-xft-antialias=1
-gtk-xft-hinting=1
-gtk-xft-hintstyle=hintslight
-gtk-xft-rgba=none
+++ /dev/null
-general {
- output_format = "i3bar"
- interval = 6
- color_good = "#85c000"
- color_degraded = "#b58900"
- color_bad = "#dc322f"
-}
-
-order += "wireless wlan0"
-order += "ethernet _first_"
-order += "cpu_usage"
-order += "load"
-order += "battery 0"
-order += "tztime local"
-
-wireless wlan0 {
- format_up = "WLAN0 %essid %ip"
- format_down = ""
-}
-
-ethernet _first_ {
- format_up = "ETH %ip"
- format_down = ""
-}
-
-cpu_usage {
- format = "CPU %usage "
- max_threshold = 90
- degraded_threshold = 50
- separator = false
- separator_block_width = 0
-}
-
-load {
- format = "%1min %5min %15min"
- max_threshold = "1.5"
-}
-
-battery 0 {
- format = "%status %percentage %remaining"
- format_down = ""
- low_threshold = 20
-}
-
-tztime local {
- format = "%a/%b %d/%m/%Y %H:%M:%S"
-}
+++ /dev/null
-general {
- output_format = "xmobar"
- interval = 2
- separator = ""
- color_good = "#85c000"
- color_degraded = "#b58900"
- color_bad = "#dc322f"
-}
-
-order += "cpu_usage"
-order += "load"
-order += "wireless wlan0"
-order += "ethernet em0"
-
-cpu_usage {
- format = "%usage "
- max_threshold = 90
- degraded_threshold = 50
- separator = false
- separator_block_width = 0
-}
-
-load {
- format = "%1min %5min %15min\n"
- max_threshold = "1.5"
-}
-
-wireless wlan0 {
- format_up = "%essid %ip"
- format_down = "wlan down"
-}
-
-ethernet em0 {
- format_up = " <span color='$color_degraded'>%ip</span>"
- format_down = ""
-}
--- /dev/null
+# TODO: prevent ~/.python_history from being written?
+# https://unix.stackexchange.com/q/630642
+def clear():
+ import os
+ os.system('clear')
+++ /dev/null
-### load system
-include /etc/sway/config.d/*
-
-### daemons
-exec pipewire
-exec dunst
-#exec mpc-notify -d
-exec foot --server
-exec swayidle timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
-# x220t
-# TODO: check hostname to load auxillary things
-# TODO: reformat for linux
-#exec acpi_ac "0x0`sysctl -n hw.acpi.acline`"
-
-### Xorg config
-xwayland force
-exec xrdb -merge ~/.Xresources
-exec '\
- find -L "$${XDG_DATA_HOME:-~/share}/fonts" -mindepth 1 -maxdepth 2 -type d | while read -r x; do \
- [ -f "$$x/fonts.dir" ] && xset +fp "$$x"; \
- done; \
- xset fp rehash'
-
-### inputs
-input 1:1:AT_Translated_Set_2_keyboard {
- xkb_layout us
- xkb_options caps:super
- xkb_numlock enable
- repeat_delay 290
- repeat_rate 26
-}
-
-### binds
-set $mod Mod4
-
-bindsym $mod+Shift+r reload
-bindsym $mod+Shift+e exec swaynag -t warning -m Exit? -b Yes 'swaymsg exit'
-
-## terminal
-bindsym $mod+Return exec [ -n "$$TERMINAL" ] && exec $$TERMINAL || exec footclient
-bindsym $mod+KP_Enter exec [ -n "$$TERMINAL" ] && exec $$TERMINAL || exec footclient
-
-## menu
-bindsym $mod+d exec nwgdmenu
-bindsym $mod+Shift+d exec nwggrid
-bindsym $mod+Ctrl+d exec nwgbar
-
-## special
-# mpc
-#bindsym XF86AudioPlay exec mpc -h /var/mpd/socket play
-#bindsym XF86AudioStop exec mpc -h /var/mpd/socket pause
-#bindsym XF86AudioPrev exec mpc -h /var/mpd/socket cdprev
-#bindsym XF86AudioNext exec mpc -h /var/mpd/socket next
-# x220t bezel buttons
-#bindcode 198 exec rotate set normal
-#bindcode 204 exec rotate right
-
-## window management
-set $up k
-set $down j
-set $left h
-set $right l
-set $up2 Up
-set $down2 Down
-set $left2 Left
-set $right2 Right
-
-bindsym $mod+$left focus left
-bindsym $mod+$down focus down
-bindsym $mod+$up focus up
-bindsym $mod+$right focus right
-bindsym $mod+$left2 focus left
-bindsym $mod+$down2 focus down
-bindsym $mod+$up2 focus up
-bindsym $mod+$right2 focus right
-bindsym $mod+a focus parent
-bindsym $mod+z focus child
-bindsym $mod+Shift+$left move left
-bindsym $mod+Shift+$down move down
-bindsym $mod+Shift+$up move up
-bindsym $mod+Shift+$right move right
-bindsym $mod+Shift+$left2 move left
-bindsym $mod+Shift+$down2 move down
-bindsym $mod+Shift+$up2 move up
-bindsym $mod+Shift+$right2 move right
-
-bindsym $mod+i split h
-bindsym $mod+o split v
-
-floating_modifier $mod
-bindsym $mod+Shift+space floating toggle
-bindsym $mod+space focus mode_toggle
-
-bindsym $mod+f fullscreen toggle
-bindsym $mod+Shift+f fullscreen toggle global
-
-bindsym $mod+s layout stacking
-bindsym $mod+w layout tabbed
-bindsym $mod+e layout toggle split
-
-bindsym $mod+Shift+q kill
-
-bindsym $mod+Shift+minus move scratchpad
-bindsym $mod+minus scratchpad show
-
-bindsym $mod+1 workspace 1
-bindsym $mod+2 workspace 2
-bindsym $mod+3 workspace 3
-bindsym $mod+4 workspace 4
-bindsym $mod+5 workspace 5
-bindsym $mod+6 workspace 6
-bindsym $mod+7 workspace 7
-bindsym $mod+8 workspace 8
-bindsym $mod+9 workspace 9
-bindsym $mod+0 workspace 10
-workspace_auto_back_and_forth yes
-
-bindsym $mod+Shift+1 move container to workspace 1
-bindsym $mod+Shift+2 move container to workspace 2
-bindsym $mod+Shift+3 move container to workspace 3
-bindsym $mod+Shift+4 move container to workspace 4
-bindsym $mod+Shift+5 move container to workspace 5
-bindsym $mod+Shift+6 move container to workspace 6
-bindsym $mod+Shift+7 move container to workspace 7
-bindsym $mod+Shift+8 move container to workspace 8
-bindsym $mod+Shift+9 move container to workspace 9
-bindsym $mod+Shift+0 move container to workspace 10
-
-mode "translate" {
- bindsym $left resize shrink width 20 px
- bindsym $down resize grow height 20 px
- bindsym $up resize shrink height 20 px
- bindsym $right resize grow width 20 px
- bindsym $left2 resize shrink width 20 px
- bindsym $down2 resize grow height 20 px
- bindsym $up2 resize shrink height 20 px
- bindsym $right2 resize grow width 20 px
-
- bindsym Shift+$left move left 20 px
- bindsym Shift+$down move down 20 px
- bindsym Shift+$up move up 20 px
- bindsym Shift+$right move right 20 px
- bindsym Shift+$left2 move left 20 px
- bindsym Shift+$down2 move down 20 px
- bindsym Shift+$up2 move up 20 px
- bindsym Shift+$right2 move right 20 px
-
- # smaller movements
- bindsym Control+$left resize shrink width 1 px or 1 ppt
- bindsym Control+$down resize grow height 1 px or 1 ppt
- bindsym Control+$up resize shrink height 1 px or 1 ppt
- bindsym Control+$right resize grow width 1 px or 1 ppt
- bindsym Control+$left2 resize shrink width 1 px or 1 ppt
- bindsym Control+$down2 resize grow height 1 px or 1 ppt
- bindsym Control+$up2 resize shrink height 1 px or 1 ppt
- bindsym Control+$right2 resize grow width 1 px or 1 ppt
-
- bindsym Control+Shift+$left move left 1 px
- bindsym Control+Shift+$down move down 1 px
- bindsym Control+Shift+$up move up 1 px
- bindsym Control+Shift+$right move right 1 px
- bindsym Control+Shift+$left2 move left 1 px
- bindsym Control+Shift+$down2 move down 1 px
- bindsym Control+Shift+$up2 move up 1 px
- bindsym Control+Shift+$right2 move right 1 px
-
- # focus
- bindsym $mod+a focus parent
- bindsym $mod+z focus child
-
- # floating
- bindsym $mod+Shift+space floating toggle
- bindsym $mod+space focus mode_toggle
-
- # exit
- bindsym Return mode default
- bindsym Escape mode default
- bindsym $mod+r mode default
-}
-bindsym $mod+r mode "translate"
-
-
-### appearance
-font pango:monospace 10
-seat seat0 xcursor_theme Paper 16
-## borders
-default_border pixel 1
-hide_edge_borders smart
-gaps inner 6
-smart_gaps on
-## colors
-# generic
-set $bg #110800
-set $fg #93a1a1
-# focused
-set $f_bdr #cc6600
-set $f_bg #aa5500
-set $f_fg #eee8d5
-set $f_ind #4466ff
-set $f_chb #cc6600
-# inactive
-set $i_bdr #884400
-set $i_bg #221100
-set $i_fg $fg
-set $i_ind #264bd2
-set $i_chb #884400
-# urgent
-set $u_bdr #ff4444
-set $u_bg #dc322f
-set $u_fg #000000
-set $u_ind #4466ff
-set $u_chb #ff4444
-# blue
-set $b_bdr #4466ff
-set $b_bg #268bd2
-set $b_fg #fdf6e3
-set $b_ind #264db2
-set $b_chb #4466ff
-# class border backgr. text indicator child_border
-client.focused $f_bdr $f_bg $f_fg $f_ind $f_chb
-client.focused_inactive $i_bdr $i_bg $i_fg $i_ind $i_chb
-client.unfocused $i_bdr $i_bg $i_fg $i_ind $i_chb
-client.urgent $u_bdr $u_bg $u_fg $u_ind $u_chb
-client.placeholder $b_bdr $b_bg $b_fg $b_ind $b_chb
-client.background #221100
-force_display_urgency_hint 2000 ms
-
-## bars
-bar {
- position top
- tray_output primary
- status_command i3status
- separator_symbol "|"
-
- colors {
- background $bg
- statusline $fg
- separator $b_ind
-
- # class border backgr. text
- focused_workspace $f_bdr $f_bg $f_fg
- active_workspace $i_bdr $i_bg $i_fg
- inactive_workspace $i_bdr $i_bg $i_fg
- urgent_workspace $u_bdr $u_bg $u_fg
- binding_mode $b_bdr $b_bg $b_fg
- }
-}
-
-## criteria
-for_window [app_id="pinentry-qt"] floating enable
-
-### load site-local
-include config.d/*
+++ /dev/null
-#---- Generated by tint2conf 7ffd ----
-# See https://gitlab.com/o9000/tint2/wikis/Configure for
-# full documentation of the configuration options.
-#-------------------------------------
-# Gradients
-# Gradient 1
-gradient = vertical
-start_color = #110800 100
-end_color = #110800 1
-
-#-------------------------------------
-# Backgrounds
-# Background 1: Inactive desktop name, Tooltip
-rounded = 0
-border_width = 1
-border_sides = TBLR
-border_content_tint_weight = 0
-background_content_tint_weight = 0
-background_color = #221100 100
-border_color = #884400 100
-background_color_hover = #000000 0
-border_color_hover = #000000 0
-background_color_pressed = #000000 0
-border_color_pressed = #000000 0
-
-# Background 2: Urgent task
-rounded = 0
-border_width = 1
-border_sides = TBLR
-border_content_tint_weight = 0
-background_content_tint_weight = 0
-background_color = #dc322f 100
-border_color = #ff4444 100
-background_color_hover = #000000 0
-border_color_hover = #000000 0
-background_color_pressed = #000000 0
-border_color_pressed = #000000 0
-
-# Background 3: Panel
-rounded = 0
-border_width = 0
-border_sides =
-border_content_tint_weight = 0
-background_content_tint_weight = 0
-background_color = #110800 0
-border_color = #000000 0
-gradient_id = 1
-background_color_hover = #000000 0
-border_color_hover = #000000 0
-background_color_pressed = #000000 0
-border_color_pressed = #000000 0
-
-# Background 4: Active desktop name, Active task
-rounded = 0
-border_width = 1
-border_sides = TBLR
-border_content_tint_weight = 0
-background_content_tint_weight = 0
-background_color = #aa5500 100
-border_color = #cc6600 100
-background_color_hover = #000000 0
-border_color_hover = #000000 0
-background_color_pressed = #000000 0
-border_color_pressed = #000000 0
-
-# Background 5:
-rounded = 0
-border_width = 1
-border_sides = TBLR
-border_content_tint_weight = 0
-background_content_tint_weight = 0
-background_color = #268bd2 100
-border_color = #4466ff 100
-background_color_hover = #000000 0
-border_color_hover = #000000 0
-background_color_pressed = #000000 0
-border_color_pressed = #000000 0
-
-#-------------------------------------
-# Panel
-panel_items = ET:SLEEECB
-panel_size = 100% 28
-panel_margin = 0 0
-panel_padding = 0 1 0
-panel_background_id = 3
-wm_menu = 1
-panel_dock = 1
-panel_pivot_struts = 0
-panel_position = top left horizontal
-panel_layer = top
-panel_monitor = all
-panel_shrink = 0
-autohide = 0
-autohide_show_timeout = 0
-autohide_hide_timeout = 0.5
-autohide_height = 1
-strut_policy = follow_size
-panel_window_name = tint2
-disable_transparency = 1
-mouse_effects = 0
-font_shadow = 0
-mouse_hover_icon_asb = 100 0 0
-mouse_pressed_icon_asb = 100 0 0
-scale_relative_to_dpi = 0
-scale_relative_to_screen_height = 0
-
-#-------------------------------------
-# Taskbar
-taskbar_mode = multi_desktop
-taskbar_hide_if_empty = 1
-taskbar_padding = 0 0 1
-taskbar_background_id = 0
-taskbar_active_background_id = 0
-taskbar_name = 1
-taskbar_hide_inactive_tasks = 0
-taskbar_hide_different_monitor = 1
-taskbar_hide_different_desktop = 0
-taskbar_always_show_all_desktop_tasks = 0
-taskbar_name_padding = 4 0
-taskbar_name_background_id = 1
-taskbar_name_active_background_id = 4
-taskbar_name_font = monospace 8
-taskbar_name_font_color = #93a1a1 100
-taskbar_name_active_font_color = #eee8d5 100
-taskbar_distribute_size = 1
-taskbar_sort_order = center
-task_align = left
-
-#-------------------------------------
-# Task
-task_text = 1
-task_icon = 1
-task_centered = 0
-urgent_nb_of_blink = 10
-task_maximum_size = 150 0
-task_padding = 1 0 2
-task_font = monospace 8
-task_tooltip = 1
-task_thumbnail = 0
-task_thumbnail_size = 210
-task_font_color = #93a1a1 100
-task_active_font_color = #eee8d5 100
-task_urgent_font_color = #000000 100
-task_icon_asb = 80 -20 0
-task_active_icon_asb = 100 0 0
-task_urgent_icon_asb = 100 0 0
-task_iconified_icon_asb = 25 -100 0
-task_active_background_id = 4
-task_urgent_background_id = 2
-mouse_left = toggle
-mouse_middle = close
-mouse_right = toggle
-mouse_scroll_up = next_task
-mouse_scroll_down = prev_task
-
-#-------------------------------------
-# System tray (notification area)
-systray_padding = 0 0 1
-systray_background_id = 0
-systray_sort = ascending
-systray_icon_size = 0
-systray_icon_asb = 100 0 0
-systray_monitor = primary
-systray_name_filter =
-
-#-------------------------------------
-# Launcher
-launcher_padding = 0 0 1
-launcher_background_id = 0
-launcher_icon_background_id = 0
-launcher_icon_size = 0
-launcher_icon_asb = 100 0 0
-launcher_icon_theme_override = 0
-startup_notifications = 1
-launcher_tooltip = 1
-launcher_item_app = /usr/share/applications/xvkbd.desktop
-
-#-------------------------------------
-# Clock
-time1_format = %H:%M:%S
-time2_format = %a %d/%m/%Y
-time1_font = monospace 8
-time1_timezone =
-time2_timezone =
-time2_font = monospace 6
-clock_font_color = #93a1a1 100
-clock_padding = 6 0
-clock_background_id = 0
-clock_tooltip = %A, %B %d, %Y
-clock_tooltip_timezone =
-clock_lclick_command = gsimplecal
-clock_rclick_command =
-clock_mclick_command =
-clock_uwheel_command =
-clock_dwheel_command =
-
-#-------------------------------------
-# Battery
-battery_tooltip = 1
-battery_low_status = 5
-battery_low_cmd = notify-send -u critical -t 0 -a system -i battery-low 'Battery critical'
-battery_full_cmd = notify-send -t 10000 -a system -i battery-full 'Battery full'
-bat1_font = monospace 8
-bat2_font = monospace 6
-battery_font_color = #93a1a1 100
-bat1_format = %p %h:%m
-bat2_format = %s
-battery_padding = 0 0
-battery_background_id = 0
-battery_hide = 101
-battery_lclick_command =
-battery_rclick_command =
-battery_mclick_command =
-battery_uwheel_command =
-battery_dwheel_command =
-ac_connected_cmd = compton
-ac_disconnected_cmd = killall compton
-
-#-------------------------------------
-# Separator 1
-separator = new
-separator_background_id = 0
-separator_color = #264db2 100
-separator_style = line
-separator_size = 1
-separator_padding = 5 0
-
-#-------------------------------------
-# Executor 1
-execp = new
-execp_command = ~/bin/i3-mode hide-default
-execp_interval = 0
-execp_has_icon = 0
-execp_cache_icon = 0
-execp_continuous = 1
-execp_markup = 1
-execp_tooltip =
-execp_lclick_command = i3-msg mode default
-execp_rclick_command =
-execp_mclick_command =
-execp_uwheel_command =
-execp_dwheel_command =
-execp_font = monospace 10
-execp_font_color = #fdf6e3 100
-execp_padding = 10 0
-execp_background_id = 5
-execp_centered = 0
-execp_icon_w = 0
-execp_icon_h = 0
-
-#-------------------------------------
-# Executor 2
-execp = new
-execp_command = ~/bin/tint2-alsa
-execp_interval = 0
-execp_has_icon = 1
-execp_cache_icon = 1
-execp_continuous = 1
-execp_markup = 0
-execp_tooltip =
-execp_lclick_command = urxvtc -e alsamixer
-execp_rclick_command =
-execp_mclick_command =
-execp_uwheel_command = amixer set Master 1%+
-execp_dwheel_command = amixer set Master 1%-
-execp_font_color = #000000 100
-execp_padding = 0 0
-execp_background_id = 0
-execp_centered = 0
-execp_icon_w = 0
-execp_icon_h = 0
-
-#-------------------------------------
-# Executor 3
-execp = new
-execp_command = ~/bin/tint2-wifi
-execp_interval = 0
-execp_has_icon = 1
-execp_cache_icon = 1
-execp_continuous = 1
-execp_markup = 0
-execp_tooltip =
-execp_lclick_command = sh -c 'wifimgr || urxvtc -e sudo wifish'
-execp_rclick_command =
-execp_mclick_command =
-execp_uwheel_command =
-execp_dwheel_command =
-execp_font_color = #000000 100
-execp_padding = 0 0
-execp_background_id = 0
-execp_centered = 0
-execp_icon_w = 0
-execp_icon_h = 0
-
-#-------------------------------------
-# Executor 4
-execp = new
-execp_command = ~/bin/tint2-i3status cpu-net
-execp_interval = 0
-execp_has_icon = 0
-execp_cache_icon = 0
-execp_continuous = 2
-execp_markup = 1
-execp_tooltip =
-execp_lclick_command = urxvtc -e sh -c 'htop || top'
-execp_rclick_command =
-execp_mclick_command =
-execp_uwheel_command =
-execp_dwheel_command =
-execp_font = monospace 6
-execp_font_color = #93a1a1 100
-execp_padding = 0 0
-execp_background_id = 0
-execp_centered = 1
-execp_icon_w = 0
-execp_icon_h = 0
-
-#-------------------------------------
-# Tooltip
-tooltip_show_timeout = 0
-tooltip_hide_timeout = 0
-tooltip_padding = 2 0
-tooltip_background_id = 1
-tooltip_font_color = #eee8d5 100
-tooltip_font = monospace 10
-
-XDG_DESKTOP_DIR="$HOME"
+XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOWNLOAD_DIR="$HOME/dls"
XDG_TEMPLATES_DIR="$HOME"
XDG_PUBLICSHARE_DIR="$HOME/pub"
source $VIMRUNTIME/defaults.vim
-packadd matchit
+let x = ($XDG_CONFIG_HOME??($HOME."/.config"))."/vim"
+execute 'set runtimepath='.x.','.&runtimepath.','.x.'/after'
+execute 'set packpath='.x.','.&packpath.','.x.'/after'
+unlet x
-set modeline "!!!
+packadd matchit
+if !isdirectory($HOME . "/.local/share/vim")
+ call mkdir($HOME . "/.local/share/vim", "p", 0700)
+endif
set backup
-set backupdir=$HOME/var/tmp/vim//
+set backupdir=$HOME/.local/share/vim//
set backupcopy=yes
+if !isdirectory($HOME . "/.local/state/vim")
+ call mkdir($HOME . "/.local/state/vim", "p", 0700)
+endif
set undofile
-set undodir=$HOME/var/tmp/vim//
+set undodir=$HOME/.local/state/vim//
set autoindent
set colorcolumn=80
highlight ColorColumn term=NONE ctermbg=0
-" filetype should be on from defaults.vim
autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab
autocmd FileType markdown setlocal tabstop=4 shiftwidth=4 expandtab
autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 expandtab
match WhiteSpaceMol / /
2match WhiteSpaceBol /\(^ \+\)\|\( \+$\)/
-let g:Modeliner_format='ft= fenc= et ts= sts= sw= tw='
-
" vim: set et fenc=utf-8 ft=vim sts=4 sw=4 ts=8 tw=79 :
--- /dev/null
+Subproject commit 7f4e4dfc58c480d154116614e616d90aac77204d
--- /dev/null
+Subproject commit e87cd90dc09c2a203e13af9704bd0ef79303d755
--- /dev/null
+Subproject commit 5a36fd29df63ea3f65562bd2bb837be48a5ec90b
--- /dev/null
+Subproject commit 3d188ed2113431cf8dac77be61b842acb64433d9
+++ /dev/null
-[Alsa]
-card=default
-
-[Notification]
-show_notification=false
-notification_type=0
-
-[StatusIcon]
-stepsize=5
-onclick=~/bin/xmixer
-theme=Default
-use_panel_specific_icons=false
-lmb_slider=true
-mmb_mute=true
-use_horizontal_slider=true
-show_sound_level=true
-use_transparent_background=false
-
-[Hotkeys]
-up_enabled=true
-down_enabled=true
-mute_enabled=false
-up=XF86AudioRaiseVolume
-down=XF86AudioLowerVolume
-mute=XF86AudioMute
# NOTE: all logic here moved to .zprofile, see comments there for rationale
### load site-specific
-if [[ -f ~/.zlogin.local ]] { source ~/.zlogin.local }
+if [[ -f ${ZDOTDIR:-~}/.zlogin.local ]] { source ${ZDOTDIR:-~}/.zlogin.local }
# vim: et sts=4 sw=4 ts=8 tw=79
}
### load site-specific
-if [[ -f ~/.zlogout.local ]] { source ~/.zlogout.local }
+if [[ -f ${ZDOTDIR:-~}/.zlogout.local ]] { source ${ZDOTDIR:-~}/.zlogout.local }
# vim: et sts=4 sw=4 ts=8 tw=79
# NOTE:
-# our .zprofile is expensive, so we keep track of what has been run already,
-# and only set up what is necessary. additionally, we want to ensure that our
-# environment is set up as early as possible, so we also source .zprofile in
-# .zshenv for new non-login shells.
+# our .zprofile can be expensive, so we keep track of what has been run
+# already, and only set up what is necessary. additionally, we want to ensure
+# that our environment is set up as early as possible, so we also source
+# .zprofile in .zshenv for new non-login shells.
#
# these issues are handled by using these methods:
# * the parent shell that starts the user's session after logging in to some
# broken—in all 3 of these cases the best choice is remove it.
p=$(basename $x)
if {[[ -v _sev_gpg_forward_clean || $$ == $p ]] ||
- ! kill -0 $p 2>/dev/null} {
+ ! kill -0 $p 2>/dev/null} {
find $x -mindepth 1 -maxdepth 1 | while {read -r y} {
# XXX: real dirs will stop unlink, consider it a feature
unlink $y
# NOTE: same rationale as above
p=${$(basename $x)#.session.}
if {[[ -v _sev_tmp_clean || $$ == $p ]] ||
- ! kill -0 $p 2>/dev/null} {
+ ! kill -0 $p 2>/dev/null} {
rm -rf $x
}
}
### lang
export CHARSET=${CHARSET:-UTF-8}
export LANG=${LANG:-en_US.UTF-8}
-export LC_CTYPE=${LC_TYPE:-$LANG}
### path
# NOTE: we utilize the fact that unique arrays keep the first occurrence and
typeset -U path fpath
# add as many generic paths as possible to keep the order we want
# NOTE: /usr/{local,pkg,games} are unix/bsdisms
- # XXX: PREFIX not validated, non-posix but Termux uses it
+ # XXX: PREFIX not validated, non-posix but Termux uses it, maybe others
+ # XXX: XDG specifies ~/.local/bin as the only user-writable dir for
+ # executables, but we specify more; technically this is against spec
syspath=("$path[@]")
- path=(~/{s,}bin
+ path=(~/{.local/,}{s,}bin
{~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/sbin
{~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/bin
/usr/{X11R{7,6}/bin,games})
export _sev_setup_path=
}
+### xdg local dir
+# NOTE: need this for tmp, so confirm it exists.
+# XXX: perms are not specified for XDG dirs except runtime, but I think 760
+# makes the most sense. shouldn't break anything since no one else should
+# be poking around in our dir.
+[[ -e ~/.local ]] || mkdir -m760 ~/.local
+
### tmp
# NOTE: specs say that POSIX tmp and XDG runtime directories should exist
# until the last session is logged out (POSIX can exist for longer).
# toplevel session (i.e. SHLVL=1). this should placate most applications,
# though it is not expressly spec compliant.
if [[ ! -v _sev_tmp ]] {
- _sev_tmp=~/tmp
- # create personal tmp dir
+ _sev_tmp=~/.local/tmp
+ # NOTE: race condition/remove in use files
+ [[ -h $_sev_tmp ]] && unlink $_sev_tmp 2>/dev/null
t=${TMPDIR:-${TEMP:-${TMP:-/tmp}}}/.home-$LOGNAME
- [[ ! -e $t ]] && mkdir -m700 $t 2>/dev/null
+ # create personal tmp dir under system tmp
+ [[ -e $t ]] || mkdir -m700 $t 2>/dev/null
if [[ ! -d $t ]] {
[[ -o interactive ]] &&
- print -P "%F{red}!!! Can't create tmpdir $t%f"
- # fallback bare directories
- [[ -h $_sev_tmp ]] && unlink $_sev_tmp 2>/dev/null
- [[ ! -e $_sev_tmp ]] && mkdir -m700 $_sev_tmp 2>/dev/null
+ print -P "%F{orange}*** Can't create TMPDIR $t, using $_sev_tmp%f"
+ # fallback bare directory
+ [[ -e $_sev_tmp ]] || mkdir -m700 $_sev_tmp 2>/dev/null
+ if [[ ! -d $_sev_tmp ]] {
+ [[ -o interactive ]] &&
+ print -P "%F{red}!!! No usable TMPDIR%f"
+ unset _sev_tmp
+ } else {
+ t=$_sev_tmp
+ }
+ } elif [[ -e $_sev_tmp ]] {
+ [[ -o interactive ]] &&
+ print -P "%F{orange}*** $_sev_tmp occluded, can't link to TMPDIR $t%f"
+ _sev_tmp=$t
+ } else {
+ ln -s $t $_sev_tmp 2>/dev/null
+ }
+ if [[ -v _sev_tmp ]] {
+ # ensure dir is clean
+ _sev_zcleanup tmp
+ # finally create our subdir for this session
+ t=$_sev_tmp/.session.$$
+ if ! mkdir -m700 $t 2>/dev/null; then
+ [[ -o interactive ]] &&
+ print -P "%F{red}!!! Can't create session subdir $t, using $_sev_tmp%f"
+ t=$_sev_tmp
+ fi
+ export _sev_tmp TMPDIR=$t TEMP=$t TMP=$t
+ unset t
}
- # link home tmp for convenience if there isn't anything meaningful there
- [[ -h $_sev_tmp || ! -e $_sev_tmp ]] && ln -sfn $t $_sev_tmp 2>/dev/null
- export _sev_tmp=$(realpath $_sev_tmp)
- # ensure dir is clean
- _sev_zcleanup tmp
- # finally create our subdir for this session
- h=$_sev_tmp/.session.$$
- mkdir -m700 $h 2>/dev/null
- export TMPDIR=$h TEMP=$h TMP=$h
- unset t h
}
### xdg
if [[ ! -v _sev_setup_xdg ]] {
- # merge with any existing dirs and remove duplicates using unique arrays
+ ## merge with any existing dirs and remove duplicates using unique arrays
+ # NOTE: we are accepting whatever value might be set for CONFIG and DATA;
+ # if it wasn't set, we just use default and leave it unset
# NOTE: include and then remove CONFIG_HOME and DATA_HOME to ensure they
# are not present in the array if it was added before we got to it
- typeset -UT XDG_CONFIG_DIRS xdg_config_dirs
- export XDG_CONFIG_HOME=~/etc
- mkdir $XDG_CONFIG_HOME 2>/dev/null
- xdg_config_dirs=($XDG_CONFIG_HOME ~/.config
- {/opt,/usr/local,/usr/pkg,}/etc/xdg
- "${XDG_CONFIG_DIRS:+${xdg_config_dirs[@]}}")
- export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS#$XDG_CONFIG_HOME}
-
typeset -UT XDG_DATA_DIRS xdg_data_dirs
- export XDG_DATA_HOME=~/share
- mkdir $XDG_DATA_HOME 2>/dev/null
- xdg_data_dirs=($XDG_DATA_HOME ~/.local/share
- /{opt,usr/local,usr/pkg,usr}/share
+ if [[ -v XDG_DATA_HOME ]] {
+ export XDG_DATA_HOME
+ } elif [[ ! -e ~/.local/share ]] {
+ mkdir -m760 ~/.local/share
+ }
+ xdg_data_dirs=($XDG_DATA_HOME /{opt,usr/local,usr/pkg,usr}/share
"${XDG_DATA_DIRS:+${xdg_data_dirs[@]}}")
- export XDG_DATA_DIRS=${XDG_DATA_DIRS#$XDG_DATA_HOME}
+ # XXX: if colons are not escaped, could remove unintended part of string
+ export XDG_DATA_DIRS=${XDG_DATA_DIRS#$XDG_DATA_HOME:}
- mkdir ~/var 2>/dev/null
- export XDG_STATE_HOME=~/var/lib
- mkdir $XDG_STATE_HOME 2>/dev/null
+ typeset -UT XDG_CONFIG_DIRS xdg_config_dirs
+ if [[ -v XDG_CONFIG_HOME ]] {
+ export XDG_CONFIG_HOME
+ } elif [[ ! -e ~/.config ]] {
+ mkdir -m760 ~/.config
+ }
+ # I am of the belief .local should follow FHS /usr/local...
+ [[ -e ~/.local/etc ]] || ln -s ~/.config ~/.local/etc
+ xdg_config_dirs=($XDG_CONFIG_HOME ${XDG_CONFIG_DIRS:+"$xdg_config_dirs[@]"}
+ {/opt,/usr/local,/usr/pkg,}/etc/xdg)
+ # XXX: if colons are not escaped, could remove unintended part of string
+ export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS#$XDG_CONFIG_HOME:}
- if [[ -v _sev_tmp ]] {
- export XDG_CACHE_HOME=$_sev_tmp/.xdg.cache
- mkdir $XDG_CACHE_HOME 2>/dev/null
+ if [[ -v XDG_STATE_HOME ]] {
+ export XDG_STATE_HOME
+ } elif [[ ! -e ~/.local/state ]] {
+ mkdir -m760 ~/.local/state
+ }
- export XDG_RUNTIME_DIR=$TMPDIR/.xdg.runtime
- # same as in tmpdir creation, ensure it doesn't exist
- if [[ -h $XDG_RUNTIME_DIR ]]; then
- unlink $XDG_RUNTIME_DIR 2>/dev/null
- elif [[ -e $XDG_RUNTIME_DIR ]]; then
- rm -rf $XDG_RUNTIME_DIR 2>/dev/null
- fi
- mkdir -m700 $XDG_RUNTIME_DIR 2>/dev/null
+ if [[ ! -v XDG_CACHE_HOME ]] {
+ if [[ -v _sev_tmp ]] {
+ export XDG_CACHE_HOME=$_sev_tmp/.xdg.cache
+ [[ -e $XDG_CACHE_HOME ]] || mkdir -m700 $XDG_CACHE_HOME
+ } elif [[ ! -e ~/.cache ]] {
+ mkdir -m700 ~/.cache
+ }
+ }
+
+ # make runtime dir in our session-specific tmpdir
+ export XDG_RUNTIME_DIR=$TMPDIR/.xdg.runtime
+ # same as in tmpdir creation, ensure dir doesn't exist
+ if [[ -h $XDG_RUNTIME_DIR ]] {
+ unlink $XDG_RUNTIME_DIR 2>/dev/null
+ } elif [[ -e $XDG_RUNTIME_DIR ]] {
+ rm -rf $XDG_RUNTIME_DIR 2>/dev/null
}
+ mkdir -m700 $XDG_RUNTIME_DIR 2>/dev/null
# source user dirs after other vars
[[ -e $XDG_CONFIG_HOME/user-dirs.dirs ]] &&
### gpg home
if [[ ! -v GNUPGHOME ]] {
- export GNUPGHOME=~/etc/gnupg
+ export GNUPGHOME=${XDG_CONFIG_HOME:-~/.config}/gnupg
if [[ -d ~/.gnupg ]] {
- mv ~/.gnupg ~/etc/gnupg
+ mv ~/.gnupg ${XDG_CONFIG_HOME:-~/.config}/gnupg
}
}
# remote host before opening a shell, so that we can have the host
# communicate back to the client where it wants a socket created or ask
# the host if the path the client wants to use is writable. however, this
-# would open up too many edge cases where it wouldn't work or be clunky
-# (e.g. asking for password twice) to make it worth it.
+# would open up too many edge cases where it wouldn't work or be too
+# clunky (e.g. asking for password twice) to make it worth it.
function _gpg_socketpath {
# dirs are percent-encoded: https://stackoverflow.com/a/64312099
echo ${1//(#b)%([[:xdigit:]](#c2))/${(#):-0x$match[1]}}
}
if [[ ! -v _sev_setup_gpg_forward && -v commands[gpg] ]] {
+ # XXX: assuming /tmo exists and is writable on destination
export _GNUPG_SOCK_DEST_BASE=/tmp/.gpg-agent-forward
export _GNUPG_SOCK_DEST_EXT=$(date +%s).$RANDOM
export _GNUPG_SOCK_DEST=$_GNUPG_SOCK_DEST_BASE.$_GNUPG_SOCK_DEST_EXT
}
### gpg agent
-if [[ -v commands[gpg-connect-agent] && ( ! -v _sev_setup_gpgagent ||
- ( -v _sev_first_display && -z $_sev_first_display ) ) ]] {
+if [[ -v commands[gpg-connect-agent] &&
+ ( ! -v _sev_setup_gpgagent || -v _sev_refresh_gpgagent ) ]] {
# avoid printing if we have already set up tty before
[[ ! -v _sev_setup_gpgagent && -o interactive ]] && p=true || p=false
if {$p} {
}
export _sev_setup_gpgagent=
}
- unset p
+ unset p _sev_refresh_gpgagent
}
### ssh agent
### load site-specific
-if [[ -f ~/.zprofile.local ]] { source ~/.zprofile.local }
+if [[ -f ${ZDOTDIR:-~}/.zprofile.local ]] { source ${ZDOTDIR:-~}/.zprofile.local }
# vim: et sts=4 sw=4 ts=8 tw=79
### exports
## common
-export EDITOR=vim
-export PAGER=less
+export EDITOR=${$(whence -p nvim vim vi micro nano emacs)[(f)1]}
+export PAGER=${$(whence -p less micro nano more)[(f)1]:s/micro/& -readonly true -multiopen tab/:s/nano/& --view}
## grep
# XXX: deprecated in GNU
export GREP_OPTIONS=--color=auto
export HISTSIZE=1000
export SAVEHIST=1000
## python
-export PYTHONSTARTUP=~/.pythonrc
+export PYTHONSTARTUP=${XDG_CONFIG_HOME:-~/.config}/pythonrc
+## vim
+export VIMINIT='execute "source" ($XDG_CONFIG_HOME??($HOME."/.config"))."/vim/.vimrc"'
## wayland/sway
# XXX: only do this if we're actually in wayland, but without a start script
export XDG_SESSION_TYPE=wayland
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=-1
export SDL_VIDEODRIVER=wayland
-export TERMINAL=footclient
+export TERMINAL=${$(whence -p konsole footclient urxvt xterm)[(f)1]}
### keys
bindkey -v
if (( $#terminfo == 0 )) {
# terminfo is not set or empty
function find_keymap {
- for f in ${ZDOTDIR:-$HOME}/.zkbd/$TERM{-${DISPLAY:-$VENDOR-$OSTYPE},}
+ for f in ${ZDOTDIR:-~}/.zkbd/$TERM{-${DISPLAY:-$VENDOR-$OSTYPE},}
[[ -f $f ]] && keymap=$f && break
}
find_keymap
unset a k v
### abbreviation aliases
-alias h='history -25'
+alias h='fc -l -25'
alias j='jobs -l'
alias l='ls -AF'
if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] {
} else {
alias ll='ls -lAFh'
}
-alias p=${PAGER:-more} # TODO: make sure more is there or use alternate
-alias e=${EDITOR:-vi} # TODO: make sure vi is there or use alternate
+alias p=$PAGER
+alias e=$EDITOR
alias se=sudoedit
# be paranoid
alias cp='cp -ip'
# TODO: similar behavior for non-freebsd, or impliment in zsh
alias rm='rm -i'
}
+[[ -v commands[trash-put] ]] && alias t=trash-put
## py venv
alias va='source bin/activate'
alias vd=deactivate
## ps
-source ~/bin/.check-busybox
+source ~/.local/bin/.check-busybox
if [[ -v commands[pstree] ]] && ! check-busybox pstree; then
# use pstree, but NOT busybox pstree because it kinda sucks
ps="pstree -wg3"
};;
*)
## sound
- # TODO: test alsa/oss/sndio/portaudio/pulse in order of importance
+ # TODO: test alsa/oss/sndio/portaudio/pulse/pipewire in order of importance
function s {}
function vol {}
esac
zstyle ':completion:*' original false
zstyle ':completion:*' select-prompt '%B%l%b'
zstyle ':completion:*' verbose true
-autoload -Uz compinit && compinit
+autoload -Uz compinit
+cache=${XDG_CACHE_HOME:-~/.cache}/zsh
+[[ -d $cache ]] || mkdir -p $cache
+compinit -d $cache/.zcompdump
### prompt
autoload -Uz promptinit && promptinit
prompt arrows
### load site-specific
-if [[ -f ~/.zshrc.local ]] { source ~/.zshrc.local }
+if [[ -f ${ZDOTDIR:-~}/.zshrc.local ]] { source ${ZDOTDIR:-~}/.zshrc.local }
# vim: et sts=4 sw=4 ts=8 tw=79
# XXX: no checks for color terminal or if escapes work, except for echotc
local m n p s r c d u
- #TODO remove n?
+ #TODO: remove n?
m=${1:-2line} # Mode
n=${2:-white} # Normal
p=${3:-green} # Prompt
# add-zsh-hook should have already been autoloaded by promptinit
add-zsh-hook precmd prompt_arrows_precmd
- add-zsh-hook preexec prompt_arrows_preexec
autoload -Uz add-zle-hook-widget
add-zle-hook-widget line-init prompt_arrows_keymap_select
add-zle-hook-widget keymap-select prompt_arrows_keymap_select
vcs_info
}
-function prompt_arrows_preexec {
- print -Pn "%F{red}<<<%f "
-}
-
function prompt_arrows_preview {
if (( ! $#* )); then
prompt_preview_theme arrows 2line
+++ /dev/null
-Subproject commit aa3e8af7a1f0831a51fd7e638a4acb077a1e5188
+++ /dev/null
-Subproject commit a1c5674c0ec38b4cc8ba41d2c0e6187987ae7eb4
#!/bin/sh
-#NOTE: .zshenv XDG paths are hardcoded to allow non-zsh install
-
+# install location and source files
: ${DEST:=$(realpath "$HOME")}
: ${SRC:=$(dirname "$(realpath "$0")")}
+# confirm XDG vars we care about are set up
+: ${LOCAL:=.local} # NOTE: needed for bin, which has no xdg var
+: ${XDG_DATA_HOME:=$DEST/$LOCAL/share}
+: ${XDG_CONFIG_HOME:=$DEST/.config}
+: ${XDG_STATE_HOME:=$DEST/$LOCAL/state}
+: ${XDG_CACHE_HOME:=$DEST/.cache}
+
+# these are the vars we actually use
+share="${XDG_DATA_HOME#$DEST/}"
+etc="${XDG_CONFIG_HOME#$DEST/}"
+state="${XDG_STATE_HOME#$DEST/}"
+cache="${XDG_CACHE_HOME#$DEST/}"
+
# test
devnull=/dev/null
if [ "$1" = "test" ]; then
devnull=/dev/stdout
_cd() {
cd $*;
- echo " cd $*";
- echo "\$PWD=$PWD";
+ echo "-- cd $* --> $PWD";
}
alias cd="_cd"
alias mkdir="echo -- mkdir"
alias sh="echo -- sh"
fi
-# create preferred folder structure
-cd $DEST
-mkdir -p bin etc share/fonts share/themes share/icons >$devnull 2>&1
-command -v vim >$devnull 2>&1 && mkdir -pm 700 var/tmp/vim >$devnull 2>&1
-cd $SRC >$devnull
-
# ensure ostype
+# NOTE: copied from .zshenv
if [ -z "$OSTYPE" ]; then
OSTYPE=$(uname -s | tr '[:upper:]' '[:lower:]')
fi
# accomodate multiple userlands
+# XXX: assuming GNU by default
+# TODO: test for GNU, fallback to POSIX instead (no -n)
lnargs=-sfnv
case "$OSTYPE" in
freebsd*) lnargs=-sFhv;;
netbsd|openbsd*) lnargs=-sfhv;;
esac
+cd "$DEST"
+
+# create preferred folder structure
+mkdir -pm 760 "$share" "$etc" "$state" "$cache"
+ln $lnargs "$DEST/$etc" "$LOCAL/etc"
+mkdir -p "$LOCAL/bin" "$share/fonts" "$share/themes" "$share/icons"
+
+# clean out old links
+# TODO: doesn't remove dead links if realpath fails; this happens if the link
+# target doesn't exist under busybox
+find . "$share" "$etc" \
+ "$LOCAL/bin" "$share/fonts" "$share/themes" "$share/icons" \
+ "$etc/gnupg" .ssh .termux \
+ -xdev -mindepth 1 -maxdepth 1 -type l -exec sh -c '
+ r="$(realpath "{}")"
+ [ "${r#'"$SRC"'/}" != "$r" ] &&
+ '"$([ "$1" = test ] && echo 'echo +++ ')"'unlink "{}"' \;
+
+cd "$SRC" >$devnull
+
l() {
# TODO: use install?
d="$DEST/${1:-$x}"
}
# generic links
-find base -mindepth 1 -maxdepth 1 | while read -r x; do l "${x#base/}"; done
-find bin etc share -mindepth 1 -maxdepth 1 | while read -r x; do l; done
+find base -mindepth 1 -maxdepth 1 | while read -r x; do l "${x#base/}"; done
+find bin -mindepth 1 -maxdepth 1 | while read -r x; do l "$LOCAL/$x"; done
+find share -mindepth 1 -maxdepth 1 | while read -r x; do l "$share${x#share}"; done
+find etc -mindepth 1 -maxdepth 1 | while read -r x; do l "$etc${x#etc}"; done
# xorg/wayland resources
find gui -mindepth 1 -maxdepth 1 | while read -r y; do
[ ! -e "$x/index.theme" ] && continue
command -v gtk-update-icon-cache >$devnull 2>&1 &&
gtk-update-icon-cache -f "$x"
- l "share${y#gui}/$(basename "$x")"
+ l "$share${y#gui}/$(basename "$x")"
done
;;
fonts)
rm "$x/fonts.scale"
[ "$(head -1 "$x/fonts.dir" >$devnull 2>&1)" = 0 ] &&
rm "$x/fonts.dir"
- l "share${y#gui}/$(basename "$x")"
+ l "$share${y#gui}/$(basename "$x")"
done
;;
*)
find "$y" -mindepth 1 -maxdepth 1 | while read -r x; do
- l "share${x#gui}"
+ l "$share${x#gui}"
done
;;
esac
# gpg
if command -v gpg >$devnull 2>&1; then
- mkdir -p "$DEST/etc/gnupg"
+ mkdir -pm 700 "$DEST/$etc/gnupg"
find gnupg -mindepth 1 -maxdepth 1 \! -name '*.gpg' | while read -r x; do
- l "etc/$x"
+ l "$etc/$x"
done
find gnupg -mindepth 1 -maxdepth 1 -name '*.gpg' | while read -r x; do
gpg --import "$x"
# termux, assume it if android
if [ $(uname -o) = 'Android' ]; then
mkdir -p "$DEST/.termux"
- find termux -mindepth 1 -maxdepth 1 | while read -r x; do
- l ".$x"; done
- l ".termux/font.ttf" 'share/fonts/Dina-ttf/Dina.ttf'
+ find termux -mindepth 1 -maxdepth 1 | while read -r x; do l ".$x"; done
+ l '.termux/font.ttf' "$share/fonts/Dina-ttf/Dina.ttf"
fi
# vim: sts=4 sw=4 et