Polybar systemd service

This commit is contained in:
Christian Colglazier 2021-02-20 12:07:02 -05:00
parent 90a1de1a10
commit e2e6c46f98
6 changed files with 26 additions and 7 deletions

View File

@ -14,7 +14,6 @@ workspace $ws8 output DVI-D-0
workspace $ws9 output HDMI-0
workspace $ws10 output HDMI-0
exec --no-startup-id MONITOR=DVI-D-0 polybar aqua &
exec --no-startup-id compton &
exec --no-startup-id feh --bg-scale ~/Pictures/desktop/0001.jpg

View File

@ -19,8 +19,7 @@ bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+q kill
# start dmenu (a program launcher)
#bindsym $mod+d exec --no-startup-id dmenu_run -i -nb '#000000' -nf $blue -sb $pink -sf $lpink -fn 'SF Pro Display:semibold:fixed:pixelsize=18'
# start program launcher
bindsym $mod+d exec --no-startup-id rofi -show combi -theme ~/.config/rofi/themes/aqua
# change focus
bindsym $mod+j focus left
@ -173,6 +172,7 @@ exec_always --no-startup-id setxkbmap -option 'caps:super'
# Startup scripts
exec --no-startup-id sh ~/.config/scripts/connect-nas.sh
exec --no-startup-id systemctl --user start polybar
# class border backgr. text indicator child_border
client.focused $pink $pink $pink $pink $pink
@ -185,7 +185,8 @@ client.background $blue
# Removes border and title bar
for_window [class="^.*"] border pixel 4
new_window 1pixel
#new_window 1pixel
new_float normal 4
#new_window normal 0 px
# Screenshots

View File

@ -1,6 +1,3 @@
# Polybar
exec --no-startup-id MONITOR=LVDS-1 polybar aqua
# Screen brightness controls
bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness

View File

@ -58,3 +58,4 @@ sh ~/.config/scripts/audio/es8start.sh
sh ~/.config/scripts/audio/es9start.sh
launchi3
systemctl --user restart polybar

View File

@ -0,0 +1,13 @@
#!/bin/bash
# Stop all polybar instances
killall -q polybar
while pgrep -x polybar >/dev/null; do sleep 0.1; done
for monitor in $(xrandr -q | grep -e "\sconnected\s" | cut -d' ' -f1); do
if [ $monitor == 'DVI-D-0' ] || [ $monitor == 'LVDS-1' ]; then
MONITOR=$monitor polybar aqua &
fi
done

View File

@ -0,0 +1,8 @@
[Unit]
Description=Polybar
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=%h/.config/scripts/desktop/polybar-start.sh
ExecStop=killall -q polybar