dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 954ac629f797ca1164d1528f7292b3e00e0750e2
parent 430249b7a3215032a3a20789b6b98dc170e82a30
Author: pyratebeard <root@pyratebeard.net>
Date:   Fri,  8 Dec 2023 20:09:08 +0000

app bins

Diffstat:
Rcmus/bin/ara -> cmus/.local/bin/ara | 0
Rcmus/bin/wmt -> cmus/.local/bin/wmt | 0
Rdmenu/bin/rundmc -> dmenu/.local/bin/rundmc | 0
Rherbstluftwm/bin/herbstluftwm-add-gap -> herbstluftwm/.local/bin/herbstluftwm-add-gap | 0
Rherbstluftwm/bin/herbstluftwm-min_max -> herbstluftwm/.local/bin/herbstluftwm-min_max | 0
Aherbstluftwm/.local/bin/herbstluftwm-miniscratch | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rherbstluftwm/bin/herbstluftwm-remove-gap -> herbstluftwm/.local/bin/herbstluftwm-remove-gap | 0
Rmutt/bin/mail_sync -> mutt/.local/bin/mail_sync | 0
Rmutt/bin/mailfmt -> mutt/.local/bin/mailfmt | 0
Rmutt/bin/mailfmtshort -> mutt/.local/bin/mailfmtshort | 0
Anewsboat/.local/bin/boat_sync | 5+++++
11 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/cmus/bin/ara b/cmus/.local/bin/ara diff --git a/cmus/bin/wmt b/cmus/.local/bin/wmt diff --git a/dmenu/bin/rundmc b/dmenu/.local/bin/rundmc diff --git a/herbstluftwm/bin/herbstluftwm-add-gap b/herbstluftwm/.local/bin/herbstluftwm-add-gap diff --git a/herbstluftwm/bin/herbstluftwm-min_max b/herbstluftwm/.local/bin/herbstluftwm-min_max diff --git a/herbstluftwm/.local/bin/herbstluftwm-miniscratch b/herbstluftwm/.local/bin/herbstluftwm-miniscratch @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +# A script allowing to minimize and un-minimize clients in a LIFO way +# (last minimized client will be un-minimized first). +# +# `chmod +x unminimize.sh` then call it or add it to `autostart`. + + +Mod=${Mod:-Mod4} +Minimizekey=Shift-s +Unminimizekey=Ctrl-s +# get the absolute path of this script, to call it when minimizing +SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/$(basename "${BASH_SOURCE[0]}") + +hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} + +scratchclient=$(hc foreach CLIENT clients. and , echo CLIENT , sprintf ATTRSTR %c.title CLIENT substitute ATTRVALUE ATTRSTR echo ATTRVALUE | \ + grep -B1 '^scratchpad$' | head -n1 | awk -F. '{print $NF}') +# +# initialize minimize and unminimize shortcuts +# +init() { + + + # minimize current window + #hc keybind $Mod-$Minimizekey spawn "$SCRIPT_PATH" minimize + + # unminimize last window of a tag + # if the `my_minimized_age` attribute does not exist (i.e. the window has not been + # minimized with this script), use arbitrary order to unminimize + LANG=en_US.UTF-8 urxvt -title scratchpad -cd /home/pyratebeard -e vim ~/tmp/scratch & + sleep 1 + scratchclient=$(hc foreach CLIENT clients. and , echo CLIENT , sprintf ATTRSTR %c.title CLIENT substitute ATTRVALUE ATTRSTR echo ATTRVALUE | \ + grep -B1 '^scratchpad$' | head -n1 | awk -F. '{print $NF}') +echo $scratchclient + hc bring $scratchclient + hc set_attr clients.$scratchclient.floating true + hc jumpto $scratchclient +} + + +# +# minimize focused client +# +minimize() { + + hc set_attr clients.$scratchclient.minimized true + +} +maximize() { + + hc set_attr clients.$scratchclient.minimized false + hc bring $scratchclient + hc jumpto $scratchclient + +} + +if hc foreach CLIENT clients. and , echo CLIENT , sprintf ATTRSTR %c.title CLIENT substitute ATTRVALUE ATTRSTR echo ATTRVALUE | \ + grep -B1 '^scratchpad$'; then + if [[ $(hc get_attr clients.$scratchclient.minimized) == "false" ]] ; then + minimize + else + maximize + fi +else + init +fi +#[ $(hc get_attr $scratchclient.minimized) == "false" ] && minimize || init +#if [ "$1" = "minimize" ] ; then minimize ; else init ; fi diff --git a/herbstluftwm/bin/herbstluftwm-remove-gap b/herbstluftwm/.local/bin/herbstluftwm-remove-gap diff --git a/mutt/bin/mail_sync b/mutt/.local/bin/mail_sync diff --git a/mutt/bin/mailfmt b/mutt/.local/bin/mailfmt diff --git a/mutt/bin/mailfmtshort b/mutt/.local/bin/mailfmtshort diff --git a/newsboat/.local/bin/boat_sync b/newsboat/.local/bin/boat_sync @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +/usr/bin/newsboat -x reload +sleep 10