diff --git a/.Xdefaults b/.Xdefaults index d197374..2c78cc4 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -5,8 +5,10 @@ Xcursor.size: Xcursor.theme: xterm.cursorTheme: -! -- XFS -- ! +! -- XFT -- ! Xft.dpi: 96 +Xft.rgba: none +Xft.lcdfilter: 0 ! -- XIDLE -- ! XIdle*position: sw @@ -135,7 +137,7 @@ gnuplot*line8Color: coral ! -- XTERM -- ! xterm*loginShell:true -xterm*faceName: FuraCodeNerdFont +xterm*faceName: Terminus xterm*faceSize: 13 xterm*allowTitleOps: false xterm*bufferedFPS: 60 diff --git a/.bin/_config b/.bin/_config index 82f544f..59f89bf 100644 --- a/.bin/_config +++ b/.bin/_config @@ -5,6 +5,7 @@ SFONT="-slavfox-cozettehidpi-medium-r-normal--26-240-75-75-m-120-iso10646-1" BFONT="-slavfox-cozette-medium-r-normal--13-120-75-75-m-60-iso10646-1" HFONT="FuraCodeNerdFontMono:pixelsize=28" +HFONT="LuxiMono:pixelsize=28" DFONT="CozetteHidpi:pixelsize=26" NFONT="Termsyn:pixelsize=9" @@ -28,16 +29,17 @@ DMENUOPTS="-fn $DFONT -nb #181818 -nf #999999 -sf #CCCCCC -sb #181818 -i -f" DMENU_CMD="dmenu $DMENUOPTS" DMENURUN_CMD="dmenu_run $DMENUOPTS" -notify_func() { /usr/local/bin/notify-send " $(date +%H:%M) $@ "; } +notify_func() { + /usr/local/bin/notify-send \ + " $(date +%H:%M) $@ " +} NOTIFY_CMD=notify_func -# DEVELOPMENT -# -# [ ! -d "${HOME}/.dev" ] && mkdir "${HOME}/.dev" -# [ ! -f "${HOME}/.dev/dir" ] && pwd > "${HOME}/.dev/dir" -# -# DEVDIRPATH=${HOME}/.dev -# DEVDIR="$(cat "${DEVDIRPATH}/dir")" +# CHECK OR INSTALL +needs() { + pkg_info -az | grep -q ^$1$ \ + || pkg_add $1 +} # PIM # diff --git a/.bin/dexec_vpn b/.bin/dexec_vpn new file mode 100755 index 0000000..b914d56 --- /dev/null +++ b/.bin/dexec_vpn @@ -0,0 +1,34 @@ +#!/bin/sh + +. ~/.bin/_config + +LIST="$(cat /etc/wireguard/vpnlist.txt)" +SEL="$(print "$LIST\ndeactivate" | cut -d' ' -f1 | $DMENU_CMD -l 20 -p "VPN")" + +[ -z "$SEL" ] && exit 0 + +if [ "$SEL" == "deactivate" ] +then + ACTIVE=$(ifconfig | grep wg-quick | cut -d: -f3 | tr -d " ") + if [ ! -z "$ACTIVE" ] + then + doas wg-quick down $ACTIVE && $NOTIFY_CMD "VPN: disconnected" + sleep 1 + fi + exit 0 +fi + +HOST="$(echo "$LIST" | fgrep "$SEL" | cut -d' ' -f2)" + +cat /etc/wireguard/template.conf | sed "s/XXXXXX/$HOST/g" > /tmp/vpn.conf + +doas mv /tmp/vpn.conf /etc/wireguard/vpn.conf + +ACTIVE=$(ifconfig | grep wg-quick | cut -d: -f3 | tr -d " ") +if [ ! -z "$ACTIVE" ] +then + doas wg-quick down $ACTIVE && $NOTIFY_CMD "VPN: disconnected" + sleep 1 +fi + +doas wg-quick up vpn && $NOTIFY_CMD "VPN: $HOST" diff --git a/.bin/documents-grep b/.bin/documents-grep index 89cf946..677280d 100755 --- a/.bin/documents-grep +++ b/.bin/documents-grep @@ -1,5 +1,7 @@ #/bin/sh -xe . ${HOME}/.bin/_config +needs pdfgrep + cd ${PIMDIR}/documents pdfgrep --cache -n -H "${*}" *.pdf diff --git a/.bin/documents-import b/.bin/documents-import index 50cfd4f..8d2441a 100755 --- a/.bin/documents-import +++ b/.bin/documents-import @@ -1,6 +1,6 @@ #/bin/sh -xe . ${HOME}/.bin/_config - +needs tesseract doas pkg_add tesseract tesseract-deu ocrmypdf mkdir -p ${PIMDIR}/documents/_incoming diff --git a/.bin/xcons b/.bin/xcons new file mode 100755 index 0000000..4bd86ff --- /dev/null +++ b/.bin/xcons @@ -0,0 +1,25 @@ +#!/bin/sh + +# set the following quirk in .config/spectrwm/spectrwm.conf +# quirk[XConsole] = FLOAT + ANYWHERE + +# get XConsole window id +WID=$(wmctrl -x -l XConsole | fgrep '.XConsole' | cut -d" " -f1) + +if [ -z "$WID" ] +then + xconsole & +else + # check if window is iconfified or on another WS (or both) + if xwininfo -id $WID | fgrep -q IsUnMapped + then + # move window to current workspace + #wmctrl -i -r $WID -t $(xprop -root _NET_CURRENT_DESKTOP | cut -d'=' -f2) + wmctrl -i -r $WID -t $_SWM_WS + # remove hidden flag + wmctrl -i -r $WID -b remove,hidden + else + # window is visible => hide + wmctrl -i -r $WID -b add,hidden + fi +fi diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 5e47a61..e68768e 100644 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -6,22 +6,13 @@ true - true - - - hintslight + false - bgr - - - true + none - lcdlight - - - 96 + lcdnone diff --git a/.config/spectrwm/spectrwm.conf b/.config/spectrwm/spectrwm.conf index 3003a86..a99dc5c 100644 --- a/.config/spectrwm/spectrwm.conf +++ b/.config/spectrwm/spectrwm.conf @@ -100,6 +100,8 @@ click_to_raise = 1 # +-------------------------------------------------- quirk[mpv] = FLOAT + ANYWHERE + FOCUSPREV +quirk[hl] = FLOAT + ANYWHERE + FOCUSPREV +quirk[hashlink] = FLOAT + ANYWHERE + FOCUSPREV quirk[scratchpad] = FLOAT + ANYWHERE + FOCUSPREV quirk[XConsole:xconsole] = FLOAT + ANYWHERE + NOFOCUSCYCLE + NOFOCUSONMAP