Compare commits

...

11 Commits

Author SHA1 Message Date
David JULIEN 0e4354faf3
Merge branch 'dev' into venus
mail : [WIP] fix filtering for univ
        fix notifications through cronie
        add keymaps for next- and previous-new
displayselect: add "mode" variable for xrandr setup
        add external layout for docked setup
system: change default lockscreen to xss-lock
2022-11-25 21:18:11 +01:00
David JULIEN 81e5498349 [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
2022-11-25 16:44:41 +01:00
David JULIEN d62bd902a0 [mail] feat: keymaps to next- or previous-new mail 2022-11-24 09:20:05 +01:00
David JULIEN 5a4c0abad0 [system] feat: change default lockscreen to xss-lock 2022-11-23 23:36:29 +01:00
David JULIEN 3a8e28ad46 [mail] fix: notifications through cronie 2022-11-23 23:36:29 +01:00
David JULIEN 46b806234d [scripts] feat: add "mode" variable to xrandr setup 2022-11-22 10:29:49 +01:00
David JULIEN cceef6fe61 [WIP][mail] fix: mail flitering 2022-11-21 10:19:14 +01:00
David JULIEN 6332ebd1da Merge branch 'dev' into venus
mpd: fix check for existing instance
scripts: fix displayselect layout selection
2022-11-19 19:16:04 +01:00
David JULIEN fff6cc7ca8 [status] fix: space in sb-cpu 2022-11-18 12:14:53 +01:00
David JULIEN 1d9fc97dcf [scripts] fix: displayselect layout selection 2022-11-17 18:15:18 +01:00
David JULIEN 296518e619 [mpd] fix: checking for existing instance 2022-11-14 11:06:51 +01:00
7 changed files with 48 additions and 11 deletions

View File

@ -10,14 +10,15 @@ redshift &
dunst &> /dev/null & #temp fix
gentoo-pipewire-launcher && wpctl set-volume @DEFAULT_AUDIO_SINK@ 50% &
# MPD daemon start (if no other user instance exists)
[ ! -s "$XDG_CONFIG_HOME/mpd/pid" ] && mpd
[ -z "$(pgrep -fx mpd)" ] && mpd
[ -z "$(pgrep -f sb-mpdup)" ] && sb-mpdup &
sbacklight set 3 &
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 &
cursor_setup "Logitech Gaming Mouse G502" &
setxkbmap 'fr(oss)'

View File

@ -13,6 +13,8 @@ macro index,pager im '<sync-mailbox><enter-command>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 <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop

View File

@ -44,16 +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() {
xrandr --output "$primary" --auto --scale 1.0x1.0 \
--output "$secondary" --"$direction"-of "$primary" --auto
[ -z "$mode" ] && mode="auto"
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.
@ -78,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\\n\\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' ' ') ;;

18
.local/bin/get_dbus Executable file
View File

@ -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

View File

@ -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.

View File

@ -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#* }