mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
desktop: add polybar dotfiles
This commit is contained in:
@@ -139,6 +139,14 @@ desktop_i3_dotfiles:
|
|||||||
src: .config/picom/picom.conf
|
src: .config/picom/picom.conf
|
||||||
dest: .config/picom/picom.conf
|
dest: .config/picom/picom.conf
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
- name: polybar config
|
||||||
|
src: .config/polybar/config.ini
|
||||||
|
dest: .config/polybar/config.ini
|
||||||
|
mode: "0644"
|
||||||
|
- name: polybar launcher
|
||||||
|
src: .config/polybar/launch.sh
|
||||||
|
dest: .config/polybar/launch.sh
|
||||||
|
mode: "0755"
|
||||||
- name: .xinitrc
|
- name: .xinitrc
|
||||||
src: .xinitrc
|
src: .xinitrc
|
||||||
dest: .xinitrc
|
dest: .xinitrc
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ desktop_i3_packages:
|
|||||||
- dunst
|
- dunst
|
||||||
- network-manager-applet
|
- network-manager-applet
|
||||||
- picom
|
- picom
|
||||||
|
- polybar
|
||||||
- rofi
|
- rofi
|
||||||
- scrot
|
- scrot
|
||||||
- setxkbmap
|
- setxkbmap
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
- "{{ user_home }}/.config/i3"
|
- "{{ user_home }}/.config/i3"
|
||||||
- "{{ user_home }}/.config/i3blocks"
|
- "{{ user_home }}/.config/i3blocks"
|
||||||
- "{{ user_home }}/.config/picom"
|
- "{{ user_home }}/.config/picom"
|
||||||
|
- "{{ user_home }}/.config/polybar"
|
||||||
- "{{ user_home }}/.config/rofi"
|
- "{{ user_home }}/.config/rofi"
|
||||||
when: "'i3' in (desktop_sessions_enabled | default([]))"
|
when: "'i3' in (desktop_sessions_enabled | default([]))"
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ exec --no-startup-id wireplumber
|
|||||||
# Compositor
|
# Compositor
|
||||||
exec_always --no-startup-id picom -b
|
exec_always --no-startup-id picom -b
|
||||||
|
|
||||||
|
# Status bar
|
||||||
|
exec_always --no-startup-id ~/.config/polybar/launch.sh
|
||||||
|
|
||||||
# Monitor configuration
|
# Monitor configuration
|
||||||
exec --no-startup-id autorandr --persistent --change
|
exec --no-startup-id autorandr --persistent --change
|
||||||
|
|
||||||
@@ -159,6 +162,17 @@ set $ws8 "8"
|
|||||||
set $ws9 "9"
|
set $ws9 "9"
|
||||||
set $ws10 "10"
|
set $ws10 "10"
|
||||||
|
|
||||||
|
workspace $ws1 output primary
|
||||||
|
workspace $ws2 output primary
|
||||||
|
workspace $ws3 output primary
|
||||||
|
workspace $ws4 output primary
|
||||||
|
workspace $ws5 output primary
|
||||||
|
workspace $ws6 output primary
|
||||||
|
workspace $ws7 output primary
|
||||||
|
workspace $ws8 output primary
|
||||||
|
workspace $ws9 output primary
|
||||||
|
workspace $ws10 output primary
|
||||||
|
|
||||||
bindsym $mod+1 workspace number $ws1
|
bindsym $mod+1 workspace number $ws1
|
||||||
bindsym $mod+2 workspace number $ws2
|
bindsym $mod+2 workspace number $ws2
|
||||||
bindsym $mod+3 workspace number $ws3
|
bindsym $mod+3 workspace number $ws3
|
||||||
@@ -208,24 +222,24 @@ mode "resize" {
|
|||||||
|
|
||||||
bindsym $mod+r mode "resize"
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
# i3bar + i3status
|
# i3bar + i3status (disabilitato: ora gestito da polybar)
|
||||||
bar {
|
# bar {
|
||||||
status_command i3blocks
|
# status_command i3blocks
|
||||||
position bottom
|
# position bottom
|
||||||
tray_output primary
|
# tray_output primary
|
||||||
font pango:Liberation Mono 10
|
# font pango:Liberation Mono 10
|
||||||
|
#
|
||||||
colors {
|
# colors {
|
||||||
background #1f1f28
|
# background #1f1f28
|
||||||
statusline #d0d0d0
|
# statusline #d0d0d0
|
||||||
separator #3a3a46
|
# separator #3a3a46
|
||||||
|
#
|
||||||
focused_workspace #4a90d9 #4a90d9 #ffffff
|
# focused_workspace #4a90d9 #4a90d9 #ffffff
|
||||||
active_workspace #3a3a46 #2b2b36 #d0d0d0
|
# active_workspace #3a3a46 #2b2b36 #d0d0d0
|
||||||
inactive_workspace #1f1f28 #1f1f28 #9a9a9a
|
# inactive_workspace #1f1f28 #1f1f28 #9a9a9a
|
||||||
urgent_workspace #c7162b #c7162b #ffffff
|
# urgent_workspace #c7162b #c7162b #ffffff
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
|
|
||||||
client.focused #4a90d9 #4a90d9 #ffffff #4a90d9 #4a90d9
|
client.focused #4a90d9 #4a90d9 #ffffff #4a90d9 #4a90d9
|
||||||
client.focused_inactive #3a3a46 #2b2b36 #eeeeee #3a3a46 #3a3a46
|
client.focused_inactive #3a3a46 #2b2b36 #eeeeee #3a3a46 #3a3a46
|
||||||
|
|||||||
208
dotfiles/desktop/.config/polybar/config.ini
Normal file
208
dotfiles/desktop/.config/polybar/config.ini
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
[colors]
|
||||||
|
background = #1f1f28
|
||||||
|
background-alt = #2b2b36
|
||||||
|
foreground = #d0d0d0
|
||||||
|
foreground-alt = #9a9a9a
|
||||||
|
primary = #4a90d9
|
||||||
|
secondary = #7dcfff
|
||||||
|
warm = #e0af68
|
||||||
|
success = #9ec07c
|
||||||
|
info = #bb9af7
|
||||||
|
alert = #c7162b
|
||||||
|
disabled = #3a3a46
|
||||||
|
|
||||||
|
[bar/main]
|
||||||
|
monitor = ${env:MONITOR:}
|
||||||
|
bottom = false
|
||||||
|
width = 100%
|
||||||
|
height = 24pt
|
||||||
|
radius = 0
|
||||||
|
background = ${colors.background}
|
||||||
|
foreground = ${colors.foreground}
|
||||||
|
line-size = 2pt
|
||||||
|
border-size = 0
|
||||||
|
padding-left = 1
|
||||||
|
padding-right = 1
|
||||||
|
module-margin = 1
|
||||||
|
|
||||||
|
font-0 = Liberation Mono:size=10;2
|
||||||
|
font-1 = Symbols Nerd Font Mono:size=12;2
|
||||||
|
|
||||||
|
modules-left = i3
|
||||||
|
modules-center = date
|
||||||
|
modules-right = cpu memory disk temperature backlight wifi battery
|
||||||
|
|
||||||
|
tray-position = right
|
||||||
|
tray-padding = 2
|
||||||
|
|
||||||
|
cursor-click = pointer
|
||||||
|
|
||||||
|
wm-restack = i3
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
[module/i3]
|
||||||
|
type = internal/i3
|
||||||
|
pin-workspaces = false
|
||||||
|
show-urgent = true
|
||||||
|
strip-wsnumbers = true
|
||||||
|
enable-scroll = false
|
||||||
|
index-sort = true
|
||||||
|
|
||||||
|
ws-icon-0 = 1;I
|
||||||
|
ws-icon-1 = 2;II
|
||||||
|
ws-icon-2 = 3;III
|
||||||
|
ws-icon-3 = 4;IV
|
||||||
|
ws-icon-4 = 5;V
|
||||||
|
ws-icon-5 = 6;VI
|
||||||
|
ws-icon-6 = 7;VII
|
||||||
|
ws-icon-7 = 8;VIII
|
||||||
|
ws-icon-8 = 9;IX
|
||||||
|
ws-icon-9 = 10;X
|
||||||
|
ws-icon-default =
|
||||||
|
|
||||||
|
label-focused = %icon%
|
||||||
|
label-focused-foreground = #ffffff
|
||||||
|
label-focused-background = ${colors.primary}
|
||||||
|
label-focused-padding = 1
|
||||||
|
|
||||||
|
label-unfocused = %icon%
|
||||||
|
label-unfocused-foreground = ${colors.foreground-alt}
|
||||||
|
label-unfocused-padding = 1
|
||||||
|
|
||||||
|
label-visible = %icon%
|
||||||
|
label-visible-foreground = ${colors.foreground}
|
||||||
|
label-visible-background = ${colors.background-alt}
|
||||||
|
label-visible-padding = 1
|
||||||
|
|
||||||
|
label-urgent = %icon%
|
||||||
|
label-urgent-foreground = #ffffff
|
||||||
|
label-urgent-background = ${colors.alert}
|
||||||
|
label-urgent-padding = 1
|
||||||
|
|
||||||
|
[module/date]
|
||||||
|
type = internal/date
|
||||||
|
interval = 60
|
||||||
|
date = %Y-%m-%d
|
||||||
|
time = %H:%M
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-foreground = ${colors.foreground-alt}
|
||||||
|
label = %date% %time%
|
||||||
|
label-foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
[module/memory]
|
||||||
|
type = internal/memory
|
||||||
|
interval = 10
|
||||||
|
format = <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-foreground = ${colors.secondary}
|
||||||
|
label = %gb_used% / %gb_total%
|
||||||
|
label-foreground = ${colors.secondary}
|
||||||
|
|
||||||
|
[module/temperature]
|
||||||
|
type = internal/temperature
|
||||||
|
interval = 10
|
||||||
|
thermal-zone = 0
|
||||||
|
warn-temperature = 80
|
||||||
|
format = <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-foreground = ${colors.warm}
|
||||||
|
format-warn = <label-warn>
|
||||||
|
format-warn-prefix = " "
|
||||||
|
format-warn-prefix-foreground = ${colors.alert}
|
||||||
|
label = %temperature-c%
|
||||||
|
label-foreground = ${colors.warm}
|
||||||
|
label-warn = %temperature-c%
|
||||||
|
label-warn-foreground = ${colors.alert}
|
||||||
|
|
||||||
|
[module/backlight]
|
||||||
|
type = internal/backlight
|
||||||
|
card = intel_backlight
|
||||||
|
use-actual-brightness = true
|
||||||
|
enable-scroll = true
|
||||||
|
format = <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-foreground = ${colors.foreground}
|
||||||
|
label = %percentage%%
|
||||||
|
label-foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
[module/wifi]
|
||||||
|
type = internal/network
|
||||||
|
interface-type = wireless
|
||||||
|
interval = 5
|
||||||
|
format-connected = <label-connected>
|
||||||
|
format-connected-prefix = " "
|
||||||
|
format-connected-prefix-foreground = ${colors.primary}
|
||||||
|
format-disconnected = <label-disconnected>
|
||||||
|
format-disconnected-prefix = " "
|
||||||
|
format-disconnected-prefix-foreground = ${colors.disabled}
|
||||||
|
label-connected = %essid% %signal%%
|
||||||
|
label-connected-foreground = ${colors.primary}
|
||||||
|
label-disconnected = offline
|
||||||
|
label-disconnected-foreground = ${colors.disabled}
|
||||||
|
|
||||||
|
[module/battery]
|
||||||
|
type = internal/battery
|
||||||
|
battery = BAT0
|
||||||
|
adapter = AC
|
||||||
|
full-at = 98
|
||||||
|
low-at = 15
|
||||||
|
|
||||||
|
format-charging = <animation-charging> <label-charging>
|
||||||
|
format-discharging = <ramp-capacity> <label-discharging>
|
||||||
|
format-full = <label-full>
|
||||||
|
format-low = <label-low>
|
||||||
|
|
||||||
|
format-full-prefix = " "
|
||||||
|
format-full-prefix-foreground = ${colors.success}
|
||||||
|
|
||||||
|
label-charging = %percentage%%
|
||||||
|
label-charging-foreground = ${colors.success}
|
||||||
|
label-discharging = %percentage%%
|
||||||
|
label-discharging-foreground = ${colors.foreground}
|
||||||
|
label-full = full
|
||||||
|
label-full-foreground = ${colors.success}
|
||||||
|
label-low = %percentage%%
|
||||||
|
label-low-foreground = ${colors.alert}
|
||||||
|
|
||||||
|
ramp-capacity-0 =
|
||||||
|
ramp-capacity-1 =
|
||||||
|
ramp-capacity-2 =
|
||||||
|
ramp-capacity-3 =
|
||||||
|
ramp-capacity-4 =
|
||||||
|
ramp-capacity-foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
animation-charging-0 =
|
||||||
|
animation-charging-1 =
|
||||||
|
animation-charging-2 =
|
||||||
|
animation-charging-3 =
|
||||||
|
animation-charging-4 =
|
||||||
|
animation-charging-foreground = ${colors.success}
|
||||||
|
animation-charging-framerate = 750
|
||||||
|
|
||||||
|
[module/cpu]
|
||||||
|
type = internal/cpu
|
||||||
|
interval = 5
|
||||||
|
format = <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-foreground = ${colors.info}
|
||||||
|
label = %percentage%%
|
||||||
|
label-foreground = ${colors.info}
|
||||||
|
|
||||||
|
[module/disk]
|
||||||
|
type = internal/fs
|
||||||
|
mount-0 = /
|
||||||
|
interval = 60
|
||||||
|
format-mounted = <label-mounted>
|
||||||
|
format-mounted-prefix = " "
|
||||||
|
format-mounted-prefix-foreground = ${colors.success}
|
||||||
|
label-mounted = %used% / %total%
|
||||||
|
label-mounted-foreground = ${colors.success}
|
||||||
|
format-unmounted = <label-unmounted>
|
||||||
|
format-unmounted-prefix = " "
|
||||||
|
format-unmounted-prefix-foreground = ${colors.disabled}
|
||||||
|
label-unmounted = %mountpoint% n/a
|
||||||
|
label-unmounted-foreground = ${colors.disabled}
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
screenchange-reload = true
|
||||||
|
pseudo-transparency = false
|
||||||
20
dotfiles/desktop/.config/polybar/launch.sh
Normal file
20
dotfiles/desktop/.config/polybar/launch.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Restart polybar on each connected monitor.
|
||||||
|
|
||||||
|
polybar-msg cmd quit >/dev/null 2>&1 || true
|
||||||
|
|
||||||
|
while pgrep -u "$UID" -x polybar >/dev/null; do
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
if command -v xrandr >/dev/null 2>&1; then
|
||||||
|
monitors=$(xrandr --query | awk '/ connected/ {print $1}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${monitors:-}" ]; then
|
||||||
|
for m in $monitors; do
|
||||||
|
MONITOR="$m" polybar main >/dev/null 2>&1 &
|
||||||
|
done
|
||||||
|
else
|
||||||
|
polybar main >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user