launch script fixed for laptop desktop and multimonitor laptop
This commit is contained in:
parent
0c28e77342
commit
1536c75241
2 changed files with 20 additions and 18 deletions
|
@ -25,8 +25,9 @@ pseudo-transparency = true
|
||||||
|
|
||||||
[section/base]
|
[section/base]
|
||||||
monitor = ${env:MONITOR:eDP1}
|
monitor = ${env:MONITOR:eDP1}
|
||||||
|
tray-position = ${env:TRAY_POS:right}
|
||||||
|
|
||||||
[bar/main]
|
[bar/laptop]
|
||||||
inherit = section/base
|
inherit = section/base
|
||||||
width = 99.4%
|
width = 99.4%
|
||||||
height = 24pt
|
height = 24pt
|
||||||
|
@ -50,8 +51,6 @@ font-2 = Inter:size=10:weight=regular;2
|
||||||
cursor-click = pointer
|
cursor-click = pointer
|
||||||
enable-ipc = true
|
enable-ipc = true
|
||||||
|
|
||||||
tray-position = right
|
|
||||||
|
|
||||||
override-redirect = true
|
override-redirect = true
|
||||||
wm-restack = i3
|
wm-restack = i3
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@ enable-ipc = true
|
||||||
override-redirect = true
|
override-redirect = true
|
||||||
wm-restack = i3
|
wm-restack = i3
|
||||||
|
|
||||||
[bar/laptop]
|
[bar/desktop]
|
||||||
inherit = section/base
|
inherit = section/base
|
||||||
width = 99.4%
|
width = 99.4%
|
||||||
height = 24pt
|
height = 24pt
|
||||||
|
@ -91,9 +90,9 @@ offset-x = 0.3%
|
||||||
offset-y = 0.7%
|
offset-y = 0.7%
|
||||||
;radius = 8
|
;radius = 8
|
||||||
|
|
||||||
modules-left = i3
|
modules-left = i3 sep title
|
||||||
modules-center = date dot time
|
modules-center = date dot time
|
||||||
modules-right = cpu dot memory dot pulseaudio sep filesystem
|
modules-right = cpu dot gpu dot memory dot pulseaudio sep filesystem
|
||||||
|
|
||||||
background = ${colors.base}
|
background = ${colors.base}
|
||||||
foreground = ${colors.text}
|
foreground = ${colors.text}
|
||||||
|
|
|
@ -8,17 +8,20 @@ while pgrep -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
screens=$(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f6)
|
screens=$(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f6)
|
||||||
|
|
||||||
|
if [[ $(hostnamectl | grep Chassis | awk '{print $2}') == "laptop" ]]; then
|
||||||
if [[ $(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f4 | cut -d"+" -f2- | uniq | wc -l) == 1 ]]; then
|
if [[ $(xrandr --listactivemonitors | grep -v "Monitors" | cut -d" " -f4 | cut -d"+" -f2- | uniq | wc -l) == 1 ]]; then
|
||||||
MONITOR=$(polybar --list-monitors | cut -d":" -f1) TRAY_POS=right polybar main &
|
MONITOR=$(polybar --list-monitors | cut -d":" -f1) TRAY_POS=right polybar laptop &
|
||||||
else
|
else
|
||||||
primary=$(xrandr --query | grep primary | cut -d" " -f1)
|
primary=$(xrandr --query | grep primary | cut -d" " -f1)
|
||||||
|
|
||||||
for m in $screens; do
|
for m in $screens; do
|
||||||
if [[ $primary == "$m" ]]; then
|
if [[ $primary == "$m" ]]; then
|
||||||
MONITOR=$m TRAY_POS=right polybar main &
|
MONITOR=$m TRAY_POS=right polybar laptop &
|
||||||
else
|
else
|
||||||
MONITOR=$m TRAY_POS=none polybar secondary &
|
MONITOR=$m TRAY_POS=none polybar secondary &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
MONITOR=$(polybar --list-monitors | cut -d":" -f1) TRAY_POS=right polybar desktop &
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue