From 2587f3f30c1757fc6609b9ab9294e12700c195b6 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado <55825613+luevano@users.noreply.github.com> Date: Sat, 19 Dec 2020 20:57:17 -0700 Subject: Finally have a working bspwm + sxhkd + lemonbar, still WIP¿ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/bspwm/bspwmrc | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to '.config/bspwm/bspwmrc') diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index b152f41..ca9335f 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -1,23 +1,35 @@ #!/bin/sh -# Checks if X program is already running, if not, run it. -pgrep -x sxhkd > /dev/null || sxhkd & -pgrep -x statusbar > /dev/null || statusbar & +# Checks if sxhkd is running, if not, run it. +# Also use setsid so it's appart from status bar +# and the kill doesn't ruin it. +pgrep -x sxhkd > /dev/null || setsid sxhkd & -# Multihead. +# This starts or restarts statusbar. Be careful +# with pkill, if neither of these two programs have +# a 'setsid' prepended to their command, sxhdk wil crash. +if [ $(pgrep -x statusbar | wc -l) = 1 ];then + pkill -x statusbar + statusbar & +else + statusbar & +fi + +# Multihead stuff. if [ $(uname -n) = "arch" ]; then - MAINMON="DP-0" + MAINMON="DP-0" SECMON="HDMI-0" - - bspc monitor $MAINMON -d 1 2 3 4 5 - bspc monitor $SECMON -d 6 7 8 9 10 - if [ $(pgrep -f bspwm_enforce_monitor_position) < 2]; then + # Run a script to select the main monitor. + if [ $(pgrep -f bspwm_enforce_monitor_position | wc -l) < 2]; then bspwm_enforce_monitor_position $MAINMON '^1' & else killall bspwm_enforce_monitor_position bspwm_enforce_monitor_position $MAINMON '^1' & fi + + bspc monitor $MAINMON -d 1 2 3 4 5 + bspc monitor $SECMON -d 6 7 8 9 10 else bspc monitor -d I II III IV V VI VII VIII IX X fi -- cgit v1.2.3-54-g00ecf