From 0b3f5e4f0cc745bc108b9c7849accda70715494e Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Fri, 15 May 2026 20:20:01 +0200 Subject: [PATCH] desktop: add polybar dotfiles --- ansible/inventory/group_vars/desktop.yml | 8 + ansible/inventory/group_vars/void.yml | 1 + .../roles/profile_desktop_i3/tasks/main.yml | 1 + dotfiles/desktop/.config/i3/config | 50 +++-- dotfiles/desktop/.config/polybar/config.ini | 208 ++++++++++++++++++ dotfiles/desktop/.config/polybar/launch.sh | 20 ++ 6 files changed, 270 insertions(+), 18 deletions(-) create mode 100644 dotfiles/desktop/.config/polybar/config.ini create mode 100644 dotfiles/desktop/.config/polybar/launch.sh diff --git a/ansible/inventory/group_vars/desktop.yml b/ansible/inventory/group_vars/desktop.yml index 196e50e..5b70216 100644 --- a/ansible/inventory/group_vars/desktop.yml +++ b/ansible/inventory/group_vars/desktop.yml @@ -139,6 +139,14 @@ desktop_i3_dotfiles: src: .config/picom/picom.conf dest: .config/picom/picom.conf 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 src: .xinitrc dest: .xinitrc diff --git a/ansible/inventory/group_vars/void.yml b/ansible/inventory/group_vars/void.yml index 1fc3822..32660b8 100644 --- a/ansible/inventory/group_vars/void.yml +++ b/ansible/inventory/group_vars/void.yml @@ -164,6 +164,7 @@ desktop_i3_packages: - dunst - network-manager-applet - picom + - polybar - rofi - scrot - setxkbmap diff --git a/ansible/roles/profile_desktop_i3/tasks/main.yml b/ansible/roles/profile_desktop_i3/tasks/main.yml index d8252b5..68ec2b5 100644 --- a/ansible/roles/profile_desktop_i3/tasks/main.yml +++ b/ansible/roles/profile_desktop_i3/tasks/main.yml @@ -13,6 +13,7 @@ - "{{ user_home }}/.config/i3" - "{{ user_home }}/.config/i3blocks" - "{{ user_home }}/.config/picom" + - "{{ user_home }}/.config/polybar" - "{{ user_home }}/.config/rofi" when: "'i3' in (desktop_sessions_enabled | default([]))" diff --git a/dotfiles/desktop/.config/i3/config b/dotfiles/desktop/.config/i3/config index 5c6baf9..ce26821 100644 --- a/dotfiles/desktop/.config/i3/config +++ b/dotfiles/desktop/.config/i3/config @@ -21,6 +21,9 @@ exec --no-startup-id wireplumber # Compositor exec_always --no-startup-id picom -b +# Status bar +exec_always --no-startup-id ~/.config/polybar/launch.sh + # Monitor configuration exec --no-startup-id autorandr --persistent --change @@ -159,6 +162,17 @@ set $ws8 "8" set $ws9 "9" 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+2 workspace number $ws2 bindsym $mod+3 workspace number $ws3 @@ -208,24 +222,24 @@ mode "resize" { bindsym $mod+r mode "resize" -# i3bar + i3status -bar { - status_command i3blocks - position bottom - tray_output primary - font pango:Liberation Mono 10 - - colors { - background #1f1f28 - statusline #d0d0d0 - separator #3a3a46 - - focused_workspace #4a90d9 #4a90d9 #ffffff - active_workspace #3a3a46 #2b2b36 #d0d0d0 - inactive_workspace #1f1f28 #1f1f28 #9a9a9a - urgent_workspace #c7162b #c7162b #ffffff - } -} +# i3bar + i3status (disabilitato: ora gestito da polybar) +# bar { +# status_command i3blocks +# position bottom +# tray_output primary +# font pango:Liberation Mono 10 +# +# colors { +# background #1f1f28 +# statusline #d0d0d0 +# separator #3a3a46 +# +# focused_workspace #4a90d9 #4a90d9 #ffffff +# active_workspace #3a3a46 #2b2b36 #d0d0d0 +# inactive_workspace #1f1f28 #1f1f28 #9a9a9a +# urgent_workspace #c7162b #c7162b #ffffff +# } +# } client.focused #4a90d9 #4a90d9 #ffffff #4a90d9 #4a90d9 client.focused_inactive #3a3a46 #2b2b36 #eeeeee #3a3a46 #3a3a46 diff --git a/dotfiles/desktop/.config/polybar/config.ini b/dotfiles/desktop/.config/polybar/config.ini new file mode 100644 index 0000000..7832a80 --- /dev/null +++ b/dotfiles/desktop/.config/polybar/config.ini @@ -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 =