dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit 974683eef8ae8bafa5f2cb7aae084ad93c5c2950
parent ca43e33e7d12f0b02c3dfacc09d35f2e20a9bfac
Author: Chris Noxz <chris@noxz.tech>
Date:   Mon, 30 Mar 2020 18:28:18 +0200

update scripts and configs to match new version of ztatus

Diffstat:
M.exclude/etc/mpv/scripts/ztatus.lua | 2+-
Mbin/.local/bin/dmenu_mount | 2+-
Mbin/.local/bin/dmenu_umount | 2+-
Mbin/.local/bin/listen-new-mail | 4++--
Mbin/.local/bin/listen-new-pkg | 2+-
Mbin/.local/bin/operations | 21+--------------------
Abin/.local/bin/ztatus-notify | 4++++
Msxhkd/.config/sxhkd/sxhkdrc | 11-----------
8 files changed, 11 insertions(+), 37 deletions(-)

diff --git a/.exclude/etc/mpv/scripts/ztatus.lua b/.exclude/etc/mpv/scripts/ztatus.lua @@ -94,7 +94,7 @@ function notify_current_track() )) end - os.execute(("ztatusc notify %s"):format(body)) + os.execute(("printf %s > /tmp/ztatus.fifo"):format(body)) end function notify_metadata_updated(name, value) diff --git a/bin/.local/bin/dmenu_mount b/bin/.local/bin/dmenu_mount @@ -44,4 +44,4 @@ mntpnt="$( [ "$mntpnt" = "" ] || [ ! -d "$mntpnt" ] && exit 1 # finally mount the partition -sudo mount $part $mntpnt && ztatusc notify "'$part' mounted at '$mntpnt'" +sudo mount $part $mntpnt && ztatus-notify "'$part' mounted at '$mntpnt'" diff --git a/bin/.local/bin/dmenu_umount b/bin/.local/bin/dmenu_umount @@ -34,4 +34,4 @@ part="$( \ )" [ "$part" = "" ] && exit -sudo umount $part && ztatusc notify "'$part' unmounted" +sudo umount $part && ztatus-notify "'$part' unmounted" diff --git a/bin/.local/bin/listen-new-mail b/bin/.local/bin/listen-new-mail @@ -2,11 +2,11 @@ # Listen for changes forever while true; do - ls -d \ + ls -d \ "$HOME"/mail/webmail-*/INBOX/new/ \ "$HOME"/mail/webmail-*/INBOX/new/* \ 2>/dev/null | entr -n -r -a -d -p 2>/dev/null echo count="$(find "$HOME"/mail/webmail-*/INBOX/new/* 2>/dev/null | wc -l)" - [ "$count" != "0" ] && ztatusc notify "you have $count new mail(s)" + [ "$count" != "0" ] && ztatus-notify "you have $count new mail(s)" ztatusc update mail done diff --git a/bin/.local/bin/listen-new-pkg b/bin/.local/bin/listen-new-pkg @@ -3,6 +3,6 @@ # Listen for changes forever ls /var/db/xbps/pkgdb*.plist | entr -n -p -s ' count="$(pkg queue | wc -l)" - [ "$count" != "0" ] && ztatusc notify "you have $count new pakage(s)" + [ "$count" != "0" ] && ztatus-notify "you have $count new pakage(s)" ztatusc update updates ' diff --git a/bin/.local/bin/operations b/bin/.local/bin/operations @@ -9,7 +9,6 @@ case "$option" in list) echo notify echo sync-mail - echo ztatus ;; notify) text="$( @@ -18,29 +17,11 @@ notify) || echo "$2" )" if [ "$text" != "" ]; then - ztatusc notify "$text" + ztatus-notify "$text" else operations dmenu ${args} fi ;; -ztatus) - case "$2" in - list) - echo show-time - ;; - show-time) - ztatusc toggle datetime - ;; - dmenu|"") - option="$(operations ztatus list | dmenu_vtc${args} -p ztatus:)" - if [ "$option" != "" ]; then - operations ztatus "$option" - else - operations dmenu "${args}" - fi - ;; - esac -;; sync-mail) "$HOME"/.local/bin/mbsync-stdin < "$XDG_CONFIG_HOME"/mbsync/template -a -V for f in "$HOME"/mail/webmail-*/INBOX/new/*; do touch "$f" 2>/dev/null; done diff --git a/bin/.local/bin/ztatus-notify b/bin/.local/bin/ztatus-notify @@ -0,0 +1,4 @@ +#!/bin/sh + +fifo="/tmp/ztatus.fifo" +printf '%s' "$*" > "$fifo" diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc @@ -106,9 +106,6 @@ super + F4 dmenu_power # --- operations -------------------------------------------------------------- -# :toggle date time visibillity -super + t - operations ztatus show-time # :sync email super + shift + e operations sync-mail @@ -151,14 +148,6 @@ super + XF86AudioPrev super + XF86AudioNext mpvc next -# --- ztatus ------------------------------------------------------------------ -# :toggle volume -super + apostrophe; 1 - echo toggle volume > /tmp/ztatus.fifo -# :toggle power -super + apostrophe; 2 - echo toggle power > /tmp/ztatus.fifo - # --- misc -------------------------------------------------------------------- # :record screen region shift + Print