*.swo
# fontconfig
-/fonts/**/.uuid
-/fonts/**/fonts.dir
-/fonts/**/fonts.scale
+/gui/fonts/**/.uuid
+/gui/fonts/**/fonts.dir
+/gui/fonts/**/fonts.scale
[submodule "vim-repeat"]
path = base/.vim/pack/repeat.vim/start/vim-repeat
url = https://github.com/tpope/vim-repeat
-[submodule "urxvt-font-size"]
- path = urxvt-ext/urxvt-font-size
- url = https://github.com/majutsushi/urxvt-font-size
[submodule "paper-icon-theme"]
- path = xorg/icons/paper-icon-theme
+ path = gui/icons/paper-icon-theme
url = https://github.com/snwh/paper-icon-theme
[submodule "Blackbird"]
- path = xorg/themes/Blackbird
+ path = gui/themes/Blackbird
url = https://github.com/shimmerproject/Blackbird
+++ /dev/null
-add mod3 = Scroll_Lock
Xft.hintstyle: hintslight
! theming
-Xcursor.theme: Paper-Mono-Dark
+Xcursor.theme: Paper
! colors
*background: #010812
! light grey/white
*color7: #bcc2cc
*color15: #e8ebee
-
-! URxvt
-URxvt.termName: rxvt-unicode-256color
-URxvt.perl-ext:
-URxvt.perl-ext-common: searchable-scrollback,confirm-paste,matcher,font-size
-
-URxvt.depth: 32
-URxvt.background: rgba:0100/0800/1200/d000
-URxvt.internalBorder: 1
-URxvt.dynamicColors: true
-URxvt.intensityStyles: false
-URxvt.cursorBlink: on
-URxvt.scrollstyle: plain
-URxvt.scrollBar_right: true
-URxvt.urgentOnBell: true
-URxvt.visualBell: true
-
-URxvt.url-launcher: xdg-open
-URxvt.matcher.button: 2
-URxvt.matcher.pattern.0: [a-zA-Z\d]+:/\/[\\w-](?:\\.?[\\w-]+)*(?::\\d{1,5})?(?:/(?:[\\w\\d\\.!#$&\\-;=?~[\\]/]|%[\\da-fA-F]{2})*)?
-URxvt.matcher.rend.0: Uline Bold fg6
-!URxvt.matcher.pattern.1: \\s(/\\S+?):(\\d+)(?=:|$)
-!URxvt.matcher.rend.1: Uline fg3
-!URxvt.matcher.launcher.1: urxvtc -e vim +$2 $1
-URxvt.keysym.M-o: matcher:last
-URxvt.keysym.M-u: matcher:list
-URxvt.keysym.M-plus: font-size:increase
-URxvt.keysym.M-minus: font-size:decrease
-URxvt.keysym.M-equal: font-size:reset
-URxvt.keysym.M-slash: font-size:show
-
-URxvt.print-pipe: cat > "$HOME/urxvt-$(date +'%Y-%m-%d-%H%M%S')"
-
-! bg terminal 1
-TermBg1.termName: rxvt-unicode-256color
-TermBg1.perl-ext:
-TermBg1.perl-ext-common:
-
-TermBg1.scrollBar: false
-TermBg1.cursorUnderline: true
-TermBg1.visualBell: true
-
-TermBg1.depth: 32
-TermBg1.borderLess: true
-TermBg1.transparent: true
-TermBg1.shading: 80
-TermBg1.blurRadius: 2x4
-
-! bg terminal 2
-TermBg2.termName: rxvt-unicode-256color
-TermBg2.perl-ext:
-TermBg2.perl-ext-common:
-
-TermBg2.scrollBar: false
-TermBg2.cursorUnderline: true
-TermBg2.visualBell: true
-
-TermBg2.depth: 32
-TermBg2.borderLess: true
-TermBg2.transparent: true
-
-! xvkbd
-xvkbd.Alt_R.width: 1
-xvkbd.Meta_R.width: 1
-xvkbd.Multi_key.width: 1
-xvkbd.Shift_R.width: 75
+gtk-font-name="monospace-10"
gtk-theme-name="Blackbird"
gtk-icon-theme-name="Paper-Mono-Dark"
-gtk-font-name="monospace-10"
-gtk-cursor-theme-name="Paper-Mono-Dark"
+gtk-cursor-theme-name="Paper"
-Subproject commit f8238d70f873969fb41bf6a6b07ca63a4c0b82b1
+Subproject commit 627308e30639be3e2d5402808ce18690557e8292
-Subproject commit fe98cfaa7ea9c4b838d42a6830437c919eb55b4e
+Subproject commit 95da3d72efc91a5131acf388eafa4b1ad6512a9b
-Subproject commit f51a26d3710629d031806305b6c8727189cd1935
+Subproject commit baf89ad26488f6a7665d51b986f5c7ad2d22b30b
-Subproject commit 6845221d45bd62e604c2024bc511a56e79d1118b
+Subproject commit ed9d639de2e34eafb82f2682010ab361966ee40f
+++ /dev/null
-#!/bin/zsh
-# using zsh to load .zshenv (eg. for PATH) but file is sh-compatible
-
-# Xorg settings
-# TODO: create shim for cpp
-xrdb -merge ~/.Xresources
-xmodmap ~/.Xmodmap
-xset r rate 290 26 &
-xset m 1/1 0 &
-xset s off
-xset dpms 0 0 600
-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
-
-# redshift, root image
-redon &
-wall &
-
-# root terminal
-urxvt -name TermBg1 -override-redirect -geometry x5+0--1 \
- -e tail -F /var/log/messages &
-xdotool search --limit 1 --sync --classname TermBg1 windowsize --usehints 100% 6
-
-# tray icons
-#"$HOME/src/phwmon/phwmon.py" --mem --mem_percent --net --io --bg \#0000 &
-volumeicon &
-
-# daemons
-dunst &
-mpc-notify -d &
-xautolock -time 10 -locker "$HOME/bin/lck" &
-xbanish &
-
-if [ -z "$TERMINAL" -a \( -x $(which -a urxvtd | head -1) \) ]; then
- for i in 1 2; do
- # try to start client twice, once before checking for daemon
- # and another after trying to start it
- urxvtc -e exit >/dev/null 2>&1
- if [ $? -eq 2 ]; then
- # daemon not started, attempt to start once
- if [ $i -eq 1 ]; then
- urxvtd -q -o -f
- else
- TERMINAL=urxvt
- export TERMINAL
- fi
- else
- TERMINAL=urxvtc
- export TERMINAL
- break
- fi
- done
- unset i
-fi
-
-# taskbar
-# sleep to wait for session to start fully
-(sleep 0.1 && tint2) &
-
-# x220t
-# TODO: check hostname to load auxillary things
-# TODO: reformat for linux
-#(sleep 0.1 "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") &
-
-# start session
-if [ -z "$1" ]; then
- session=i3
-else
- session=$1
- shift
-fi
-exec $session "$@"
# add as many generic paths as possible to keep the order we want
# NOTE: /usr/{local,pkg,games} are unix/bsdisms
syspath=("$path[@]")
- path=({~/,/,/usr/}sbin /opt/{s,}bin /usr/local/{s,}bin /usr/pkg/{s,}bin
- /usr/X11R{7,6}/bin /usr/games {~/,/,/usr/}bin)
+ path=({~,~/.local,,/usr,/opt,/usr/local,/usr/pkg}/sbin
+ {~,~/.local,,/usr,/opt,/usr/local,/usr/pkg}/bin
+ /usr/X11R{7,6}/bin /usr/games)
((len=$#path))
path=("$path[@]" "$syspath[@]")
# remove nonexistent and duplicate paths
# 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
- typeset -UT XDG_DATA_DIRS xdg_data_dirs
- export XDG_CONFIG_HOME=$HOME/etc
- xdg_config_dirs=($XDG_CONFIG_HOME $HOME/.config
+ export XDG_CONFIG_HOME=~/etc
+ mkdir -p $XDG_CONFIG_HOME
+ 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}
- export XDG_DATA_HOME=$HOME/share
- xdg_data_dirs=($XDG_DATA_HOME $HOME/.local/share
+
+ typeset -UT XDG_DATA_DIRS xdg_data_dirs
+ export XDG_DATA_HOME=~/share
+ mkdir -p $XDG_DATA_HOME
+ xdg_data_dirs=($XDG_DATA_HOME ~/.local/share
/{opt,usr/local,usr/pkg,usr}/share
"${XDG_DATA_DIRS:+${xdg_data_dirs[@]}}")
export XDG_DATA_DIRS=${XDG_DATA_DIRS#$XDG_DATA_HOME}
+
+ export XDG_STATE_HOME=~/var/lib
+ mkdir -p $XDG_STATE_HOME
+
# use our custom tmp for cache and runtime
export XDG_CACHE_HOME=$_sev_tmp/.xdg.cache
export XDG_RUNTIME_DIR=$_sev_tmp/.xdg.runtime
elif [[ -e $x ]]; then
rm -rf $x 2>/dev/null
fi
+ # XXX: cache does not have to be 700 according to spec
mkdir -m700 $x 2>/dev/null
done
+
# source user dirs after other vars
[[ -e $XDG_CONFIG_HOME/user-dirs.dirs ]] &&
emulate sh -c "source $XDG_CONFIG_HOME/user-dirs.dirs"
# 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.
if [[ ! -v _sev_setup_agents ]] {
+ export GNUPGHOME=~/etc/gnupg
+
function _socketpath {
# dirs are percent-encoded: https://stackoverflow.com/a/64312099
echo ${1//(#b)%([[:xdigit:]](#c2))/${(#):-0x$match[1]}}
export SAVEHIST=1000
## python
export PYTHONSTARTUP=~/.pythonrc
+## 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
### keys
bindkey -v
+++ /dev/null
-#!/bin/sh
-exec $(which -a dmenu | grep -v "$HOME" | head -1) -b -f -fn 'monospace-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
+++ /dev/null
-#!/bin/sh
-cmd=$(dmenu_path | ~/bin/dmenu "$@")
-if [ -n "$cmd" ]; then
- # NOTE: only tested with zsh and sh, and has issues with expansion; zsh
- # SH_WORD_SPLIT is unset by default, `=' flag is required to expand it.
- # XXX: probably has issues with single quotes
- # XXX: does not perform any(!) shell expansion
- echo "alias sudo='sudo -Ak'
-cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
-if [ -n "$ZSH_VERSION" ]; then
- out="$(${=cmd} 2>&1)"
-else
- out="$($cmd 2>&1)"
-fi
-code=$?
-out="$(echo "$out" | tail -n 3)"
-notify-send -t 10000 -u $([ $code != 0 ] && echo normal || echo low) -a ' "'$(basename $0)'" ' "${cmd}$([ $code != 0 ] && echo \: $code)" "$out"' | SUDO_ASKPASS=~/bin/dpass ${SHELL:-"/bin/sh"}
-fi
+++ /dev/null
-#!/bin/sh
-. ~/bin/.check-busybox
-p="$1"
-if [ -z "$p" ] && ! check-busybox ps; then
- p="[$(ps -o comm= -p $(ps -o ppid= -p $$))]";
-fi
-~/bin/dmenu -p "$p" -fn Dina-10 -nb \#110800 -nf \#110800 -sb \#264bd2 -sf \#fdf6e3 <&-
-unset check-busybox
dmenu = "~/bin/dmenu -p dunst:"
browser = /usr/bin/firefox
-[shortcuts]
close = mod4+shift+grave
#close_all = mod4+mod2+grave
history = mod4+grave
[Settings]
+gtk-font-name=monospace 10
gtk-theme-name=Blackbird
gtk-icon-theme-name=Paper-Mono-Dark
-gtk-font-name=monospace 10
-gtk-cursor-theme-name=Paper-Mono-Dark
+gtk-application-prefer-dark-theme=true
+gtk-cursor-theme-name=Paper
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_SMALL_TOOLBAR
+### load system
+include /etc/sway/config.d/*
+
+### exports
+# XXX: this works but I feel like it shouldn't
+exec '\
+ export XDG_SESSION_TYPE=${XDG_SESSION_TYPE:-wayland}; \
+ export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-wayland-egl}; \
+ export QT_WAYLAND_DISABLE_WINDOWDECORATION=${QT_WAYLAND_DISABLE_WINDOWDECORATION:--1}; \
+ export SDL_VIDEODRIVER=${SDL_VIDEODRIVER:-wayland}; \
+ export TERMINAL=${TERMINAL:-footclient}'
+
+### daemons
+exec dunst
+exec foot --server
+#exec mpc-notify -d
+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
+# XXX: this works but I feel like it shouldn't
+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
+}
-# master modifier key
+### binds
set $mod Mod4
-### important binds ###
-# reload the configuration file
-bindsym $mod+Shift+c reload
-# restart i3 inplace
-bindsym $mod+Shift+r restart
-# exit i3
-bindsym $mod+Shift+e exec --no-startup-id i3-nagbar -t warning -m Exit? -b Yes 'i3-msg exit'
-
-### applications ###
-# x220t bezel buttons
-bindcode 198 exec --no-startup-id rotate set normal
-bindcode 204 exec --no-startup-id rotate right
+bindsym $mod+Shift+r reload
+bindsym $mod+Shift+e exec swaynag -t warning -m Exit? -b Yes 'swaymsg exit'
-# terminal
-bindsym $mod+Return exec --no-startup-id i3-sensible-terminal
+## terminal
+bindsym $mod+Return exec [ -n "$$TERMINAL" ] && exec $$TERMINAL || exec footclient
-# dmenu
-bindsym $mod+d exec --no-startup-id $HOME/bin/dmenu_runsmart -p "%"
+## menu
+bindsym $mod+d exec nwgdmenu
+bindsym $mod+Shift+d exec nwggrid
+bindsym $mod+Ctrl+d exec nwgbar
+## special
# mpc
-bindsym XF86AudioPlay exec --no-startup-id mpc -h /var/mpd/socket play
-bindsym XF86AudioStop exec --no-startup-id mpc -h /var/mpd/socket pause
-bindsym XF86AudioPrev exec --no-startup-id mpc -h /var/mpd/socket cdprev
-bindsym XF86AudioNext exec --no-startup-id mpc -h /var/mpd/socket next
-
+#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 ###
-# directional keys
+## window management
set $up k
set $down j
set $left h
set $right l
-# arrow keys for completeness
set $up2 Up
set $down2 Down
set $left2 Left
set $right2 Right
-# change focus
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$down2 focus down
bindsym $mod+$up2 focus up
bindsym $mod+$right2 focus right
-# move focused window
+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+$up2 move up
bindsym $mod+Shift+$right2 move right
-# split in horizontal orientation
bindsym $mod+i split h
-# split in vertical orientation
bindsym $mod+o split v
-# mouse+$mod to drag floating windows
floating_modifier $mod
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+space focus mode_toggle
-# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+f fullscreen toggle global
-# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
-# toggle tiling / floating
-bindsym $mod+Shift+space floating toggle
-
-# change focus between tiling / floating windows
-bindsym $mod+space focus mode_toggle
-
-# focus the parent container
-bindsym $mod+a focus parent
-
-# focus the child container
-bindsym $mod+z focus child
-
-# kill focused window
bindsym $mod+Shift+q kill
-# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
-
-# Show the next scratchpad window or hide the focused scratchpad window.
-# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
-# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
-# repeat workspace to go back
workspace_auto_back_and_forth yes
-# move focused container to workspace
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+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
+bindsym $mod+Shift+0 move container to workspace 10
-# move and resize [floating] windows
mode "translate" {
bindsym $left resize shrink width 20 px
bindsym $down resize grow height 20 px
bindsym Control+Shift+$up2 move up 1 px
bindsym Control+Shift+$right2 move right 1 px
- # toggle tiling / floating
- bindsym $mod+Shift+space floating toggle
-
- # change focus between tiling / floating windows
- bindsym $mod+space focus mode_toggle
-
- # focus the parent container
+ # focus
bindsym $mod+a focus parent
-
- # focus the child container
bindsym $mod+z focus child
- # back to normal: Enter, Escape, or original key
+ # 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
-font pango:monospace 7
-
-# windows
-for_window [class="Gsimplecal"] floating enable
-for_window [class="XMixer"] floating enable
-
-# borders
+### appearance
+font pango:monospace 10
+seat seat0 xcursor_theme Paper 16
+## borders
+default_border pixel 1
hide_edge_borders smart
-new_window pixel 1
gaps inner 6
smart_gaps on
-
-# color definitions
+## colors
# generic
set $bg #110800
set $fg #93a1a1
set $b_fg #fdf6e3
set $b_ind #264db2
set $b_chb #4466ff
-
-# deprecated in favor of tint2
-#bar {
-# position top
-# output LVDS1
-# 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
-# }
-#}
-
-# apply colors
# 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.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
-# keep urgent colors around longer
force_display_urgency_hint 2000 ms
+
+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
+ }
+}
+
+### load site-local
+include config.d/*
#NOTE: .zshenv XDG paths are hardcoded to allow non-zsh install
+: ${DEST:=$(realpath "$HOME")}
+: ${SRC:=$(dirname "$(realpath "$0")")}
+
# test
devnull=/dev/null
if [ "$1" = "test" ]; then
- echo "Running test -- no changes will be applied"
- devnull=/dev/stdout
- _cd() {
- cd $*;
- echo " cd $*";
- echo "\$PWD=$PWD";
- }
- alias cd="_cd"
- alias mkdir="echo mkdir"
- alias ln="echo ln"
- alias rm="echo rm"
- alias sh="echo sh"
+ echo "Running test -- no changes will be applied"
+ devnull=/dev/stdout
+ _cd() {
+ cd $*;
+ echo " cd $*";
+ echo "\$PWD=$PWD";
+ }
+ alias cd="_cd"
+ alias mkdir="echo -- mkdir"
+ alias ln="echo -- ln"
+ alias rm="echo -- rm"
+ alias sh="echo -- sh"
fi
# create preferred folder structure
-cd ~
-mkdir -p bin etc share share/fonts .urxvt/ext \
- .icons .themes .gnupg .ssh .termux >$devnull 2>&1
-mkdir -pm 700 var/tmp var/tmp/vim >$devnull 2>&1
-cd - >$devnull
+cd $DEST
+mkdir -p bin etc share/fonts share/themes share/icons >$devnull 2>&1
+which vim >$devnull 2>&1 && mkdir -pm 700 var/tmp/vim >$devnull 2>&1
+cd $SRC >$devnull
# ensure ostype
if [ -z "$OSTYPE" ]; then
- OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
+ OSTYPE=$(uname -s | tr '[:upper:]' '[:lower:]')
fi
# accomodate multiple userlands
lnargs=-sfnv
case "$OSTYPE" in
- freebsd*) lnargs=-sFhv;;
- netbsd|openbsd*) lnargs=-sfhv;;
+ freebsd*) lnargs=-sFhv;;
+ netbsd|openbsd*) lnargs=-sfhv;;
esac
l() {
- # TODO: use install?
- [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$PWD/$x}" "$1" || \
- echo "!!! File exists and is not a link: $1"
+ # TODO: use install?
+ [ -L "$1" -o \! -e "$1" ] && ln $lnargs "$SRC/${2:-$x}" "$DEST/${1:-$x}" ||
+ echo "!!! File exists and is not a link: $1"
}
-# link files
-find base -mindepth 1 -maxdepth 1 | while read -r x; do
- l "$HOME/`basename "$x"`"
-done
-find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
- l "$HOME/$x"
-done
-find fonts -mindepth 1 -maxdepth 1 -type d | while read -r x; do
- l "$HOME/share/fonts/`basename "$x"`"
-done
-find xdg -mindepth 1 -maxdepth 1 | while read -r x; do
- l "$HOME/etc/`basename "$x"`"
-done
-find urxvt-ext -mindepth 1 -maxdepth 2 -type f -perm -111 | while read -r x; do
- l "$HOME/.urxvt/ext/`basename $x`"
-done
-find xorg/icons -mindepth 1 -maxdepth 2 -type d | while read -r x; do
- if [ -e "$x/index.theme" ]; then
- d="$HOME/.icons/`basename "$x"`"
- l $d
- which gtk-update-icon-cache >/dev/null 2>&1 && gtk-update-icon-cache -qtf $d
- unset d
- fi
-done
-find xorg/themes -mindepth 1 -maxdepth 1 -type d | while read -r x; do
- l "$HOME/.themes/`basename "$x"`"
-done
-find gpg -mindepth 1 -maxdepth 1 \! -name '*.gpg' | while read -r x; do
- l "$HOME/.gnupg/`basename "$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
+
+# xorg/wayland resources
+find gui -mindepth 1 -maxdepth 1 | while read -r x; do
+ if [ "$x" = gui/fonts ]; then
+ find $x -mindepth 1 -maxdepth 2 -type d | while read -r x; do
+ which mkfontscale >$devnull 2>&1 && mkfontscale "$x"
+ which mkfontdir >$devnull 2>&1 && mkfontdir "$x"
+ [ "$(head -1 "$x/fonts.dir")" = 0 ] &&
+ rm "$x/fonts.dir"
+ [ "$(head -1 "$x/fonts.scale")" = 0 ] &&
+ rm "$x/fonts.scale"
+ done
+ elif [ "$x" = gui/icons ]; then
+ find $x -mindepth 1 -maxdepth 2 -type d | while read -r x; do
+ [ ! -e "$x/index.theme" ] && continue
+ which gtk-update-icon-cache >$devnull 2>&1 &&
+ gtk-update-icon-cache "$x"
+ done
+ fi
+ find "$x" -mindepth 1 -maxdepth 1 | while read -r x; do
+ l "share${x#gui}"
+ done
done
-if which gpg >/dev/null 2>&1; then
- find gpg -mindepth 1 -maxdepth 1 -name '*.gpg' | while read -r x; do
- gpg --import "$x"
- done
+
+# gpg
+if which gpg >$devnull 2>&1; then
+ mkdir -p "$DEST/etc/gnupg"
+ find gnupg -mindepth 1 -maxdepth 1 \! -name '*.gpg' | while read -r x; do
+ l "etc/$x"
+ done
+ find gnupg -mindepth 1 -maxdepth 1 -name '*.gpg' | while read -r x; do
+ gpg --import "$x"
+ done
fi
-for y in ssh termux; do
- find $y -mindepth 1 -maxdepth 1 | while read -r x; do
- l "$HOME/.$y/`basename "$x"`"
- done
-done
-x='fonts/Dina-ttf/Dina.ttf' l "$HOME/.termux/font.ttf"
+
+# ssh
+find ssh -mindepth 1 -maxdepth 1 | while read -r x; do
+ l ".$x"; done
+
+# 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'
+fi
+
+# vim: sts=4 sw=4 et
+++ /dev/null
-Subproject commit 0984499379e420de651dcfeedfbb7938867c44f8