aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkd <kdam0@localhost.localdomain>2020-08-07 15:44:02 +0000
committerkd <kdam0@localhost.localdomain>2020-08-07 15:44:02 +0000
commit17f480835f30ba35d5f77bc23a9cb2c8075d212e (patch)
tree9f89e3f0d65e12b5935798e20313840e04ff4a26
parent12a0cab63e72121319656d7e63ec9cec4358479d (diff)
updated screen.sh with tripple mon profile
-rwxr-xr-xScripts/.config/Scripts/screen.sh24
-rwxr-xr-xbspwm/.config/bspwm/bspwmrc23
2 files changed, 29 insertions, 18 deletions
diff --git a/Scripts/.config/Scripts/screen.sh b/Scripts/.config/Scripts/screen.sh
index 1bfcd53..d62992d 100755
--- a/Scripts/.config/Scripts/screen.sh
+++ b/Scripts/.config/Scripts/screen.sh
@@ -2,23 +2,35 @@
#Feed this script either:
# "l" for laptop screen only,
-# "v" for vga screen only,
+# "h" for hdmi screen only,
# or "d" for dual vga/laptop.
-d() { if [[ $(xrandr -q | grep VGA-1\ con) ]]
+MONS="$(xrandr --query | grep -w 'connected' | cut -d ' ' -f1)"
+MON_COUNT=$(echo "$MONS" | wc -l)
+PRIMARY=$(echo "$MONS" | head -n 1)
+
+d() { if [[ "$MON_COUNT" -gt 1 ]]
then param $1
- else echo "No VGA input detected."
+ else echo "No secondary input detected."
fi ;}
+
#dual() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --auto --left-of LVDS-1 ;}
-dual() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --auto --right-of LVDS-1 ;}
-laptop() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --off ;}
-vga() { xrandr --output VGA-1 --auto --output LVDS-1 --off ;}
+#dual() { xrandr --output eDP-1 --primary --auto --output HDMI-2 --auto --right-of eDP-1 ;}
+
+dual() { if [[ "$MON_COUNT" = 3 ]]
+ then xrandr --output $PRIMARY --primary --auto --output DP-1 --auto --left-of $PRIMARY --output HDMI-2 --auto --right-of $PRIMARY ; # office
+ else xrandr --output $PRIMARY --primary --auto --output HDMI-2 --auto --right-of $PRIMARY ; # home
+ fi ;}
+laptop() { xrandr --output $PRIMARY --primary --auto --output HDMI-2 --off --output DP-1 --off ;}
+#laptop() { xrandr --output LVDS-1 --primary --auto --output VGA-1 --off ;}
+hdmi() { xrandr --output HDMI-2 --auto --output $PRIMARY --off ;}
#mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;}
param() {
case $1 in
d) dual ;;
v) vga ;;
+ h) hdmi ;;
l) laptop ;;
*) echo -e "Invalid parameter. Add one of the following:\n\"d\" for dualscreen laptop and VGA.\n\"l\" for laptop only\n\"v\" for VGA only." ;;
esac ;}
diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc
index 8ac7ba2..c4dadd7 100755
--- a/bspwm/.config/bspwm/bspwmrc
+++ b/bspwm/.config/bspwm/bspwmrc
@@ -3,17 +3,20 @@ pkill sxhkd
sxhkd -c $HOME/.config/sxhkd/sxhkdrc &
sxhkd -c $HOME/.config/sxhkd/sxhkdrc_bspwm &
-m=$(bspc query -M | wc -l)
-MON=$(xrandr --query | grep -w 'connected' | awk '{print $1}' | head -n 1)
-if [ "$m" = 1 ]
+MONS="$(xrandr --query | grep -w 'connected' | cut -d ' ' -f1)"
+MON_COUNT=$(echo "$MONS" | wc -l)
+PRIMARY=$(echo "$MONS" | head -n 1)
+
+if [ "$MON_COUNT" = 2 ]
then
- bspc monitor "$MON" -d 1 2 3 4 5 6 7 8 9 10
-elif [ "$m" = 2 ]
+ bspc monitor "$PRIMARY" -d 1 2 3 4 5 6 7 8 9
+ bspc monitor HDMI-2 -d 10 || bspc monitor VGA-1 -d 10
+elif [ "$MON_COUNT" = 3 ]
then
- bspc monitor "$MON" -d 1 2 3 4 5 6 7 8 9
- bspc monitor VGA-1 -d 10
+ bspc monitor "$PRIMARY" -d 1 4 5 6 7 8 9
+ (bspc monitor HDMI-2 -d 10 && bspc monitor DP-1 -d 2 3) || bspc monitor VGA-1 -d 10
else
- bspc monitor "$MON" -d 1 2 3 4 5 6 7 8 9 10
+ bspc monitor "$PRIMARY" -d 1 2 3 4 5 6 7 8 9 10
fi
bspc config border_width 3
@@ -40,10 +43,6 @@ bspc rule -a Zathura state=tiled
bspc rule -a dropdown sticky=on state=floating hidden=on
bspc rule -a math sticky=on state=floating hidden=on
bspc rule -a email desktop='9'
-#bspc query -N -n .floating | xargs -I{} bspc node {} -t pseudo_tiled
###---Starting External Scripts---###
-##sleep 2 &
-##bspc wm -O LVDS1 VGA1 &
-#$HOME/.config/bspwm/autostart.sh
$HOME/.config/Scripts/autostart.sh