From fff6cc7ca8f3cd432c3262f1e2508fb02aa35df3 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 18 Nov 2022 12:14:53 +0100 Subject: [PATCH 1/7] [status] fix: space in sb-cpu --- .local/bin/statusbar/sb-cpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu index 7648df1..d19f7a7 100755 --- a/.local/bin/statusbar/sb-cpu +++ b/.local/bin/statusbar/sb-cpu @@ -12,7 +12,7 @@ cache=/tmp/cpubarscache stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) [ ! -f $cache ] && echo "$stats" > "$cache" old=$(cat "$cache") -printf " %s " " " +printf " %s " "" echo "$stats" | while read -r row; do id=${row%% *} rest=${row#* } From cceef6fe61d0dc0bd1bb5b08c534ccc1a1b350d5 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Mon, 21 Nov 2022 10:19:14 +0100 Subject: [PATCH 2/7] [WIP][mail] fix: mail flitering --- .config/notmuch/default/hooks/{post-new => post_new.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .config/notmuch/default/hooks/{post-new => post_new.sh} (100%) diff --git a/.config/notmuch/default/hooks/post-new b/.config/notmuch/default/hooks/post_new.sh similarity index 100% rename from .config/notmuch/default/hooks/post-new rename to .config/notmuch/default/hooks/post_new.sh From 46b806234de311ccd6a44a7b475bd3477a21d923 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Tue, 22 Nov 2022 10:29:49 +0100 Subject: [PATCH 3/7] [scripts] feat: add "mode" variable to xrandr setup --- .local/bin/displayselect | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 3c58a34..a511af4 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -52,8 +52,9 @@ default() { } setup() { + [ -z "$mode" ] && mode="auto" xrandr --output "$primary" --auto --scale 1.0x1.0 \ - --output "$secondary" --"$direction"-of "$primary" --auto + --output "$secondary" --"$direction"-of "$primary" --$mode } morescreen() { # If multi-monitor is selected and there are more than two screens. From 3a8e28ad46681702668e43d246c15d2b063523a3 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Wed, 23 Nov 2022 23:32:30 +0100 Subject: [PATCH 4/7] [mail] fix: notifications through cronie --- .config/X11/xprofile | 1 + .local/bin/get_dbus | 18 ++++++++++++++++++ .local/bin/mailsync | 11 +++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100755 .local/bin/get_dbus diff --git a/.config/X11/xprofile b/.config/X11/xprofile index a6d14fd..749350e 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -18,6 +18,7 @@ dwmblocks & xrdb "$XDG_CONFIG_HOME/X11/xresources" xrdb -merge "$XDG_STATE_HOME/xcolors" xautolock -locker slock -time 5 -corners 000- & +get_dbus & xinput set-prop 'Synaptics TM3072-003' 'libinput Tapping Enabled' 1 & xinput set-prop 'Synaptics TM3072-003' 'libinput Natural Scrolling Enabled' 1 & diff --git a/.local/bin/get_dbus b/.local/bin/get_dbus new file mode 100755 index 0000000..4ec00aa --- /dev/null +++ b/.local/bin/get_dbus @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +###################################################################### +# @author : swytch +# @file : get_dbus +# @license : GPLv3 +# @created : Wednesday May 20, 2020 18:04:01 CEST +# +# @description : retrieve and store DBUS_SESSION_BUS_ADDRESS in case +# some utilitary needs it (e.g. cronie) +###################################################################### + + +env | grep DBUS_SESSION_BUS_ADDRESS > "$HOME/.dbus/Xdbus" +echo "export DBUS_SESSION_BUS_ADDRESS" >> "$HOME/.dbus/Xdbus" +chmod 600 $HOME/.dbus/Xdbus + +exit 0 diff --git a/.local/bin/mailsync b/.local/bin/mailsync index 7cb2231..57d7f0e 100755 --- a/.local/bin/mailsync +++ b/.local/bin/mailsync @@ -23,16 +23,19 @@ eval "$(grep -h -- \ "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ "$XDG_CONFIG_HOME/zsh/.zprofile" "$HOME/.pam_environment" 2>/dev/null)" -case "$(readlink -f /sbin/init)" in - *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; -esac export GPG_TTY=$TTY +[ -r "$HOME/.dbus/Xdbus" ] && source "$HOME/.dbus/Xdbus" # Config file location must be passed at execution, not as envrionment variable [ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc" +pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" +displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" notify() { - notify-send "neomutt" " $2 new mail(s) in \`$1\` account." + [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do + export DISPLAY=$x + notify-send "neomutt" " $2 new mail(s) in \`$1\` account." + done; } # Check account for new mail. Notify if there is new content. From 5a4c0abad05ed0a0effa251a641501ae259b9b48 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Wed, 23 Nov 2022 23:33:17 +0100 Subject: [PATCH 5/7] [system] feat: change default lockscreen to xss-lock --- .config/X11/xprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 749350e..edf332c 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -17,7 +17,7 @@ setbg & dwmblocks & xrdb "$XDG_CONFIG_HOME/X11/xresources" xrdb -merge "$XDG_STATE_HOME/xcolors" -xautolock -locker slock -time 5 -corners 000- & +xss-lock -- slock & get_dbus & xinput set-prop 'Synaptics TM3072-003' 'libinput Tapping Enabled' 1 & From d62bd902a063ef371ed63dcd017a6b8748d256f5 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Thu, 24 Nov 2022 09:20:05 +0100 Subject: [PATCH 6/7] [mail] feat: keymaps to next- or previous-new mail --- .config/neomutt/maps | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/neomutt/maps b/.config/neomutt/maps index 3df953c..7088d5d 100644 --- a/.config/neomutt/maps +++ b/.config/neomutt/maps @@ -13,6 +13,8 @@ macro index,pager im 'source $XDG_CONFIG_HOME/neomu # General rebindings bind index j next-entry bind index k previous-entry +bind index J next-new +bind index K previous-new bind attach view-mailcap bind attach l view-mailcap bind editor noop From 81e549834919a1c66124a475f6a975264302500f Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 25 Nov 2022 16:44:41 +0100 Subject: [PATCH 7/7] [system] feat: add external mode to displayselect in case of laptop, one may be interested in disconnecting the internal display, if you're docked for instance this mode allows to chose an internal display to be disabled, and then configure a setup as in default mode --- .local/bin/displayselect | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index a511af4..c2176cb 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -44,17 +44,28 @@ twoscreen() { # If multi-monitor is selected and there are two screens. } default() { - primary=$(echo "$allposs" | grep -w "connected primary" | awk '{printf $1}') + primary=$(echo "$allposs" | grep -w "connected primary" | awk '{ print $1 }') secondary=$(echo "$screens" | grep -v -w "$primary") direction="left" rotation="normal" setup } +external() { + internal=$(echo "$screens" | dmenu -i -p "Select internal display:") + screens=$(echo "$screens" | grep -v -w "eDP-1") + primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + xrandr --output $primary --primary + + default +} + setup() { [ -z "$mode" ] && mode="auto" - xrandr --output "$primary" --auto --scale 1.0x1.0 \ + xrandr --output "$primary" --primary --auto --scale 1.0x1.0 \ --output "$secondary" --"$direction"-of "$primary" --$mode + + [ -n "$internal" ] && xrandr --output "$internal" --off } morescreen() { # If multi-monitor is selected and there are more than two screens. @@ -79,9 +90,10 @@ allposs=$(xrandr -q | grep -w "connected") screens=$(echo "$allposs" | awk '{print $1}') # Get user choice including multi-monitor and manual selection: -chosen=$(printf "default\\nmulti-monitor\\n%s\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && +chosen=$(printf "default\\nexternal\\nmulti-monitor\\n%s\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && case "$chosen" in "default") default ;; + "external") external ;; "manual selection") arandr ; exit ;; "multi-monitor") multimon ;; *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;