From 430b018e742ba240fa6bf94bc0618b2502af5bef Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 2 Dec 2019 21:14:39 +0100 Subject: [PATCH] Simplify i3 workspaces with polybar icons --- .config/i3/config | 8 ++++---- .config/i3/scripts/i3-applications-autostart | 6 +++--- .config/polybar/config | 20 ++++++++++++++++---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index a5dcf9a..2f60766 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -101,8 +101,8 @@ bindsym $mod+g gaps inner current set 0; gaps outer current set 0; exec picom_to # Define names for default workspaces for which we configure key bindings later on. # We use variables to avoid repeating the names in multiple places. -set $ws1 "1:" -set $ws2 "2:" +set $ws1 "1" +set $ws2 "2" set $ws3 "3" set $ws4 "4" set $ws5 "5" @@ -110,7 +110,7 @@ set $ws6 "6" set $ws7 "7" set $ws8 "8" set $ws9 "9" -set $ws10 "10:" +set $ws10 "10" # switch to workspace bindsym $mod+1 workspace $ws1 @@ -206,7 +206,7 @@ exec_always --no-startup-id polybar-launch simple-top # default workspaces for most used apps # assign [class="^qutebrowser$"] → number 1 # spotify needs for_window, see https://i3wm.org/docs/userguide.html#assign_workspace -for_window [class="^spotify$"] number "10:" +for_window [class="^spotify$"] number 10 # autostart often used apps # needs to be done like this to both automatically start the apps on correct workspace diff --git a/.config/i3/scripts/i3-applications-autostart b/.config/i3/scripts/i3-applications-autostart index ece921a..a1d9f74 100755 --- a/.config/i3/scripts/i3-applications-autostart +++ b/.config/i3/scripts/i3-applications-autostart @@ -19,11 +19,11 @@ wait_for_program() { done } -i3-msg "workspace number 2:" +i3-msg "workspace number 2" alacritty & wait_for_program -i3-msg "workspace number 10:" +i3-msg "workspace number 10" spotify & wait_for_program @@ -31,7 +31,7 @@ i3-msg "workspace number 9" keybase & wait_for_program -i3-msg "workspace number 1:" +i3-msg "workspace number 1" qutebrowser & wait_for_program diff --git a/.config/polybar/config b/.config/polybar/config index 51250f0..95b8552 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -93,6 +93,18 @@ format = ; removes numbers for workspaces which have distinct names / icons strip-wsnumbers = true +ws-icon-0 = 1; +ws-icon-1 = 2; +ws-icon-2 = 3;3 +ws-icon-3 = 4;4 +ws-icon-4 = 5;5 +ws-icon-5 = 6;6 +ws-icon-6 = 7;7 +ws-icon-7 = 8;8 +ws-icon-8 = 9; +ws-icon-9 = 10; +ws-icon-default = ♟ + ; Available tokens: ; %name% ; %icon% @@ -100,22 +112,22 @@ strip-wsnumbers = true ; %output% ; Default: %icon% %name% ; unfocused = Inactive workspace on any monitor -label-unfocused = %name% +label-unfocused = %icon% label-unfocused-padding = 4 label-unfocused-underline = ${colors.background-alt} ; focused = Active workspace on focused monitor -label-focused = %name% +label-focused = %icon% label-focused-foreground = ${colors.foreground} label-focused-background = ${colors.background-alt} label-focused-underline = ${colors.primary} label-focused-padding = ${self.label-unfocused-padding} ; visible = Active workspace on unfocused monitor -label-visible = %name% +label-visible = %icon% label-visible-background = ${self.label-focused-background} label-visible-underline = ${self.label-focused-underline} label-visible-padding = ${self.label-unfocused-padding} ; urgent = Workspace with urgency hint set -label-urgent = %name% +label-urgent = %icon% label-urgent-background = ${colors.alert} label-urgent-padding = ${self.label-unfocused-padding}