]> git.sev.monster Git - dotfiles.git/commitdiff
refactor submodules, add xorg, small fixes & changes
authords6 <git@ds6.pw>
Thu, 24 May 2018 03:28:27 +0000 (22:28 -0500)
committersev <git@sev.monster>
Fri, 5 Apr 2024 21:27:39 +0000 (16:27 -0500)
Xorg font descr changed to be less specific
Xcursor modified (pointless future-proofing)
temporarily removed urxvt unicode termName for NetBSD
fixed xdotool in xinitrc
deprecate tint2, etc in xinitrc in favor of i3status (soon conky)
LC, LANG, PATH to .zshenv; don't rely on FreeBSD login env
fixed XDG, etc vars to accept pkgsrc and other paths
fix OSTYPE, local vars, NetBSD wscons fix in .zshrc
add NetBSD mixerctl, /dev/sound aliases
improve FreeBSD sound aliases
dmenu color script no longer uses fixed dmenu path
add i3-mode, i3-printinfo; remove tint2-i3mode

install.sh:
fix & add more dirs, uname -o -> -s, add `test' arg
add xorg icons, themes, fonts; remove .hushlogin
hardcode XDG env vars, may not be set yet

19 files changed:
.gitmodules
base/.Xresources
base/.vim/pack/commentary.vim/start/vim-commentary
base/.xinitrc
base/.zshenv
base/.zshrc
bin/dmenu
bin/i3-mode [new file with mode: 0755]
bin/i3-printinfo [new file with mode: 0755]
bin/i3subscribe
bin/lck
bin/redoff
bin/redon
bin/tint2-i3mode [deleted file]
bin/yabar-i3mode [new file with mode: 0755]
install.sh
xdg/i3/config
xdg/tint2/tint2rc
xorg/icons/paper-icon-theme [new submodule]

index 22719d89fce18f909dcde42977129c3c38e333c7..7215e25a37f0a9928a325e3dfff67fe3cca82693 100644 (file)
@@ -1,18 +1,21 @@
-[submodule "base/.vim/pack/todo.txt/start/todo.txt-vim"]
+[submodule "todo.txt-vim"]
        path = base/.vim/pack/todo.txt/start/todo.txt-vim
        url = https://github.com/freitass/todo.txt-vim
-[submodule "base/.vim/pack/surround.vim/start/vim-surround"]
+[submodule "vim-surround"]
        path = base/.vim/pack/surround.vim/start/vim-surround
        url = https://github.com/tpope/vim-surround
-[submodule "base/.vim/pack/commentary.vim/start/vim-commentary"]
+[submodule "vim-commentary"]
        path = base/.vim/pack/commentary.vim/start/vim-commentary
        url = https://github.com/tpope/vim-commentary
-[submodule "base/.vim/pack/speeddating.vim/start/vim-speeddating"]
+[submodule "vim-speeddating"]
        path = base/.vim/pack/speeddating.vim/start/vim-speeddating
        url = https://github.com/tpope/vim-speeddating
-[submodule "base/.vim/pack/repeat.vim/start/vim-repeat"]
+[submodule "vim-repeat"]
        path = base/.vim/pack/repeat.vim/start/vim-repeat
        url = https://github.com/tpope/vim-repeat
-[submodule "urxvt-ext/urxvt-font-size"]
+[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
+       url = https://github.com/snwh/paper-icon-theme
index 04f76749a2d9a9d9ff0825b4638bcf61fde758e1..6e81302bd5afb89468655e05539a99ad4896fae8 100644 (file)
@@ -1,6 +1,5 @@
 ! fonts
-*font:                    -windows-dina-medium-r-normal--10-80-96-96-c-70-\
-microsoft-cp1252
+*font:                    -windows-dina-medium-r-*-*-13-80-*-*-*-*-*
 *faceName:                Dina
 *faceSize:                8
 Xft.antialias:            true
@@ -10,7 +9,7 @@ Xft.hintstyle:            hintslight
 Xft.rgba:                 none
 
 ! theming
-Xcursor.theme:            Paper
+Xcursor.theme:            Paper-Mono-Dark
 
 ! colors
 ! http://ethanschoonover.com/solarized
@@ -68,7 +67,7 @@ Xcursor.theme:            Paper
 
 
 ! URxvt
-URxvt.termName:           rxvt-unicode-256color
+URxvt.termName:           rxvt-256color
 URxvt.perl-ext:
 URxvt.perl-ext-common:    searchable-scrollback,confirm-paste,matcher,font-size
 
@@ -100,7 +99,7 @@ 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.termName:         rxvt-256color
 TermBg1.perl-ext:
 TermBg1.perl-ext-common:
 
@@ -115,7 +114,7 @@ TermBg1.shading:          80
 TermBg1.blurRadius:       2x4
 
 ! bg terminal 2
-TermBg2.termName:         rxvt-unicode-256color
+TermBg2.termName:         rxvt-256color
 TermBg2.perl-ext:
 TermBg2.perl-ext-common:
 
index 296d99b353261191adb7a356ee3fefbce8e6096b..54e5676988e6eeaa05b41730b6b056026ad0ef13 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 296d99b353261191adb7a356ee3fefbce8e6096b
+Subproject commit 54e5676988e6eeaa05b41730b6b056026ad0ef13
index 36171bfe26cb34209f5d224d3f6685c95c2cdce8..838c1e9a4b592641ae369eb7b6d92da1fe818269 100644 (file)
@@ -27,11 +27,13 @@ xset r rate 290 26 &
 xset m 1/1 0 &
 xset s off
 xset dpms 0 0 600
+xset +fp ${XDG_DATA_HOME:-~/share}/fonts/Dina/
+xset fp rehash
 
 # 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
+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 &
@@ -64,7 +66,8 @@ if [ -x /usr/local/bin/urxvtd ]; then
 fi
 
 # try to wait for session to start
-(sleep 0.1 && tint2) &
+#(sleep 0.1 && tint2) &
+#(sleep 0.1 && yabar -c "$HOME/etc/yabar/yabar.conf") &
 #x220t
 (sleep 0.1 && [ -x "$HOME/bin/acpi_ac" ] && \
        "$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") &
index 3a577ad275c84cd53f41b1e729cc70afbf0798ab..7c2fe94acf70f037d857259e948f3954ef85228b 100644 (file)
@@ -1,17 +1,35 @@
+### path
+# typeset -U makes every array entry unique
+# /usr/{pkg,local,games} are unix/bsdisms
+typeset -U path
+path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
+      /usr/local/{s,}bin /usr/games $path)
+
+### posix
 export EDITOR=vim
+export PAGER=less
+export GREP_OPTIONS=--color=auto
+export LANG="en_US.UTF-8"
+export LC_CTYPE="$LANG"
+
+### xdg
 export XDG_CONFIG_HOME=~/etc
-export XDG_CONFIG_DIRS=~/.config:/etc/xdg
+export XDG_CONFIG_DIRS=~/.config:/usr/pkg/etc/xdg:/usr/local/etc/xdg:/etc/xdg
 export XDG_DATA_HOME=~/share
-export XDG_DATA_DIRS=~/.local/share:/usr/local/share/:/usr/share/
+export XDG_DATA_DIRS=~/.local/share/:/usr/pkg/share/:/usr/local/share/:/usr/share/
 export XDG_CACHE_HOME=~/tmp
 
+### applications
 export DVTM_TERM=rxvt-unicode
-export CLICOLOR=
-export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
-export GREP_OPTIONS=--color=auto
-
 export PYTHONSTARTUP=~/.pythonrc
 
+### freebsd
+if [[ "$OSTYPE" = "freebsd" ]]; then
+       export CLICOLOR=
+       export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
+fi
+
+### load site-specific
 if [[ -f ~/.zshenv.local ]]; then
        source ~/.zshenv.local
 fi
index 0fee29708b15616d3523f50c6d373d19489ebdfa..2dd25ff460a284c708a9b6767d9f7cbf921c7062 100644 (file)
@@ -2,12 +2,6 @@
 setopt autocd extendedglob
 unsetopt beep
 
-### path
-# typeset -U makes every array entry unique; /usr/{pkg,local} are bsdisms
-typeset -U path
-path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
-      /usr/local/{s,}bin $path)
-
 ### history
 setopt appendhistory
 HISTFILE=~/.histfile
@@ -48,7 +42,7 @@ alias vd="deactivate"
 ## be paranoid
 alias cp='cp -ip'
 alias mv='mv -i'
-if [[ "$OSTYPE" = "freebsd" ]] {
+if [[ "$OSTYPE" =~ '^freebsd' ]] {
     # don't confirm if only a few files are deleted
     alias rm='rm -I'
 } else {
@@ -57,8 +51,8 @@ if [[ "$OSTYPE" = "freebsd" ]] {
 
 ### prompt
 setopt prompt_subst
-local f
-if [[ "$TERM" = "wsvt25" ]] {
+local f=
+if [[ "$OSTYPE" = "netbsd" && ( "$TERM" = "wsvt25" || "$TERM" =~ '^vt' ) ]] {
     # fix for wscons
     f="%F{white}"
 } else {
@@ -89,7 +83,7 @@ zstyle ':vcs_info:git*' unstagedstr "%F{red}*"
 unset f
 
 ### hooks
-local _exectime
+local _exectime=
 function precmd {
     # change terminal title
     print -Pn "\e]2;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\e\\"
@@ -108,29 +102,54 @@ function chpwd {
     l
 }
 
-### freebsd-specific
-if [[ "$OSTYPE" = "freebsd" ]] {
-    ## vt binds
-    bindkey    "^[[H" beginning-of-line  #Home
-    bindkey -a "^[[H" beginning-of-line
-    bindkey    "^[[F" end-of-line        #End
-    bindkey -a "^[[F" end-of-line
+### system-specific configs and aliases
+case "$OSTYPE"; in
+    freebsd*)
+        ## vt binds
+        bindkey    "^[[H" beginning-of-line  #Home
+        bindkey -a "^[[H" beginning-of-line
+        bindkey    "^[[F" end-of-line        #End
+        bindkey -a "^[[F" end-of-line
 
-    ## oss sound source
-    function s { sysctl hw.snd.default_unit${1:+\=$1} }
+        ## sound
+        function s { sysctl hw.snd.default_unit${1:+\=$1} }
+        alias vol mixer
 
-    ## install port dependencies from pkg (like pkgsrc `bmake bin-install')
-    function portpkg {
-        case "$1" {
-        build|run)
-            sudo pkg install -AU $(make ${1}-depends-list |
-                       sed 's_/usr/ports/_ _' | tr -d '\n')
-            ;;
-        *)  echo "Usage: \`portpkg <build|run>' in a port directory"
-            return 1;;
+        ## install port dependencies from pkg (like pkgsrc `bmake bin-install')
+        #XXX: should probably use package-depends where possible, breaks when
+        #     port name is different to package name
+        #     (eg. graphics/sdl20 == sdl2, devel/glib20 == glib2, etc)
+        function portpkg {
+            case "$1" {
+            build|run)
+                sudo pkg install -AU $(make ${1}-depends-list |
+                           sed 's_/usr/ports/_ _' | tr -d '\n')
+                ;;
+            *)  echo "Usage: \`portpkg <build|run>' in a port directory"
+                return 1;;
+            }
+        };;
+    netbsd)
+        ## sound
+        function s {
+            if [[ -z "$1" ]] {
+                ll /dev/mixer /dev/sound /dev/audio
+                return
+            }
+            for x in mixer sound audio; do
+                ln -sf /dev/$x"$1" /dev/$x
+            done
         }
-    }
-}
+        function vol {
+            if [[ -z "$1" ]] {
+                for x in $(mixerctl -a | grep 'outputs\.master'); do
+                    echo $x
+                done
+                return
+            }
+            mixerctl -w outputs.master"$2"="$1"
+        };;
+esac
 
 # The following lines were added by compinstall
 zstyle ':completion:*' auto-description 'specify: %d'
index 81f61e450354ef01ccdc98757ded972ed5fdf8f6..171f8c5ca3a0a92b29fd3b232be4effcd4b2a8ac 100755 (executable)
--- a/bin/dmenu
+++ b/bin/dmenu
@@ -1,2 +1,2 @@
 #!/bin/sh
-exec /usr/local/bin/dmenu -fn 'Dina-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
+exec `which -a dmenu | grep -iv ~ | head -1` -fn 'Dina-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
diff --git a/bin/i3-mode b/bin/i3-mode
new file mode 100755 (executable)
index 0000000..7835670
--- /dev/null
@@ -0,0 +1,10 @@
+#!/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
diff --git a/bin/i3-printinfo b/bin/i3-printinfo
new file mode 100755 (executable)
index 0000000..60150d6
--- /dev/null
@@ -0,0 +1,30 @@
+#!/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 better way to do this
+        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
index 166cd3ff16e37ed89ca7d82fcb487eb784eb5f9b..76f2ff201fed1e8d35e0754131901964a73fc1fd 100755 (executable)
@@ -23,13 +23,13 @@ sub subscribe {
             }
         }
     })->recv->{success}) {
-        say "Successfully subscribed to $ev-event";
+        say "Successfully subscribed to $ev event";
     }
 }
 
 my $nextArg = shift;
 if(!$nextArg) {
-    say "Subscribe to i3-events";
+    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;
diff --git a/bin/lck b/bin/lck
index 172e813b27273620433ab584e5a6ea5d8a40fa01..87cfce84c8def0845d87876d81c9589f0bb2b4ec 100755 (executable)
--- a/bin/lck
+++ b/bin/lck
@@ -36,7 +36,7 @@ ffmpeg -y -loglevel 0 \
       [out]" \
   -map "[out]" -vframes 1 "$img"
 # pause dunst
-killall -USR1 dunst
+pkill -USR1 dunst
 i3lock -nefi "$img"
 rm "$img"
-killall -USR2 dunst
+pkill -USR2 dunst
index 25c0f370940428a24189762494c3a81f724417cc..5b0cb03dc536ccf339d6e8e2b747ee01562b9ee8 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
-killall redshift > /dev/null 2>&1
+pkill redshift > /dev/null 2>&1
 redshift -m randr -x
index 055e2c7a8cee2dda30d5e642b728647c5df42d7e..72119f263382a8189750db84bb79e89041aebaa8 100755 (executable)
--- a/bin/redon
+++ b/bin/redon
@@ -1,3 +1,3 @@
 #!/bin/sh
-killall redshift > /dev/null 2>&1
+pkill redshift > /dev/null 2>&1
 redshift -l manual:lat=38.95171:lon=-92.33407 -m randr -t 6600:4000 -r &
diff --git a/bin/tint2-i3mode b/bin/tint2-i3mode
deleted file mode 100755 (executable)
index 2fc24e0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-first=true
-i3subscribe mode | while read -r x; do
-       if $first; then
-               first=false
-               continue
-       fi
-       x=${x#mode:}
-       case $x in
-               default) echo;;
-               *) echo $x;;
-       esac
-done
diff --git a/bin/yabar-i3mode b/bin/yabar-i3mode
new file mode 100755 (executable)
index 0000000..93c944a
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+i3-mode | while read -r x; do
+       [ "$x" != "default" ] && echo "!Ybg0x268bd2Y!$x" || echo "$x"
+done
index 3eeca8b9f1c4a7586ba345c7f144655720d0f2ba..e5ccd5f77ca8902157fad5a7e23e675cc0463963 100755 (executable)
@@ -11,15 +11,15 @@ fi
 
 # create preferred folder structure
 cd ~
-mkdir -p bin etc share .urxvt/ext > /dev/null 2>&1
-mkdir -m 700 var/tmp var/tmp/vim > /dev/null 2>&1
+mkdir -p bin etc share .urxvt/ext .icons .themes > /dev/null 2>&1
+mkdir -pm 700 var/tmp var/tmp/vim > /dev/null 2>&1
 cd -
 
 # accomodate multiple userlands
 fex='-perm -ugo=x'
 lnargs=-sfnv
 if [ -z "$OSTYPE" ]; then
-       OSTYPE=`uname -o | tr '[:upper:]' '[:lower:]'`
+       OSTYPE=`uname -s | tr '[:upper:]' '[:lower:]'`
 fi
 case "$OSTYPE" in
        # TODO: make links safer for systems without -Fw
@@ -47,17 +47,18 @@ done
 find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
        l "$HOME/.urxvt/ext/`basename $x`"
 done
+find "$PWD/xorg" -type d -mindepth 3 -maxdepth 3 | while read -r x; do
+       l "$HOME/.icons/`basename $x`"
+done
+#TODO: theme
 
 cd ~
 if [ "$OSTYPE" = "freebsd" ]; then
-       touch .hushlogin
-
        # FreeBSD tries `_secure_path' on `.login_conf' before reading the
        # database, so it needs to be compiled and unlinked for it to actually
        # take effect.
        rm .login_conf.db
        cap_mkdb .login_conf
-
 fi
 unlink .login_conf
 # run .zprofile to set up tmp
index a37e72e531dc3f6398a0780b490f5f6a5c22eaf5..e7e66f56d250761cde0d914a8c7cd7392ea7c3fe 100644 (file)
@@ -4,7 +4,7 @@
 # Font for window titles. Will also be used by the bar unless a different font
 # is used in the bar {} block below.
 
-font pango:Dina, DejaVu Sans Mono, monospace 7
+font pango:Dina 7
 
 # This font is widely installed, provides lots of unicode glyphs, right-to-left
 # text rendering and scalability on retina/hidpi displays (thanks to pango).
@@ -217,25 +217,26 @@ set $inactive #884400 #221100 #93a1a1 #264bd2   #884400
 set $urgent   #ff4444 #dc322f #000000 #4466ff   #ff4444
 set $blue     #4466ff #268bd2 #fdf6e3 #264db2   #4466ff
 
-#bar {
-#      position top
-#      tray_output primary
-#      status_command i3status
-#      separator_symbol "|"
-#
-#      colors {
-#              background #110800
-#              statusline #93a1a1
-#              separator  #268bd2
-#
-#              # class            border  backgr. text
-#              focused_workspace  $focused
-#              active_workspace   $inactive
-#              inactive_workspace $inactive
-#              urgent_workspace   $urgent
-#              binding_mode       $blue
-#      }
-#}
+bar {
+       position top
+       output LVDS1
+       tray_output primary
+       status_command i3status
+       separator_symbol "|"
+
+       colors {
+               background #110800
+               statusline #93a1a1
+               separator  #268bd2
+
+               # class            border  backgr. text
+               focused_workspace  $focused
+               active_workspace   $inactive
+               inactive_workspace $inactive
+               urgent_workspace   $urgent
+               binding_mode       $blue
+       }
+}
 
 # colors
 # class                 border  backgr. text    indicator child_border
index 081c965024201d2b955405fa9686b3e10eaec35d..96da1610d2f07489e13ecb1a265657be59a7e925 100644 (file)
@@ -207,7 +207,7 @@ separator_padding = 5 0
 #-------------------------------------
 # Executor 1
 execp = new
-execp_command = ~/bin/tint2-i3mode
+execp_command = ~/bin/i3-mode
 execp_interval = 0
 execp_has_icon = 0
 execp_cache_icon = 0
diff --git a/xorg/icons/paper-icon-theme b/xorg/icons/paper-icon-theme
new file mode 160000 (submodule)
index 0000000..d2476a6
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d2476a6274cd4a690d344de94984f481ca7783cc
This page took 0.08008 seconds and 4 git commands to generate.