작업 공간 모듈이 Polybar i3에 나타나지 않습니다.

작업 공간 모듈이 Polybar i3에 나타나지 않습니다.

방금 기본 i3 막대에서 폴리바 사용으로 전환했습니다(Fedora 30, i3-gaps 실행). 이 가이드에 따라 Polybar를 설치했습니다.https://computingforgeeks.com/install-polybar-status-bar-on-fedora/. 먼저 Polybar의 기본 구성을 실행해 보았는데 작업 공간이 있어야 할 왼쪽에 아무것도 없는 것을 제외하고는 잘 작동했습니다. 나는 그것을 시도해 보고 작동시키려고 노력했지만 내가 만난 포럼의 어느 누구도 비슷한 상황을 겪지 않는 것 같았습니다.

나는 이 답변에 제공된 Polybar 구성을 복사했습니다. 왜냐하면 그들이 내가 한 것과 같은 방식으로 i3 구성에서 작업 공간을 설정한 것 같았기 때문입니다.https://computingforgeeks.com/install-polybar-status-bar-on-fedora/, 그러나 결과는 동일합니다. 내 Polybar에 작업 공간 모듈이 나타나지 않습니다.

내 다중 극 구성 파일은 다음과 같습니다.

[global/wm]
margin-top = 100
margin-bottom = 100

[colors]
fg = ${xrdb:color7}
modfg = ${xrdb:color1}
bg = ${xrdb:color0}

white = #d1d1d1
gray = #585858
black = #ce1d1d1d
red = #c795ae
blue = #95aec7
yellow = #c7ae95
green = #aec795


[bar/bar1]
width = 100%
height = 41
top = true
;margin-top = 100

border-top-size = 1  # creating top border space
offset-y = -3   # aligning tray icons with rest of bar
monitor = ${env:MONITOR:}

;background = #141021
background = #000f0f0f # This is the hexcode for transparency (also used in powermenu)
foreground = #c4b7c5


fixed-center = false

font-0 = FontAwesome:pixelsize=10;0
font-1 = PragmataPro Nerd Font:pixelsize=10;0
font-2 = "Font Awesome 5 Free:style=Regular:pixelsize=10;1"
font-3 = "Font Awesome 5 Free:style=Solid:pixelsize=10;1"
font-4 = "Font Awesome 5 Brands:pixelsize=10;1"

modules-left = i3
modules-center = date
modules-right = wireless-network cpu memory filesystem temperature pulseaudio backlight battery powermenu

tray-position = right
;tray-maxsize = 41
tray-background = #000f0f0f
tray-foreground= #000f0f0f

scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev


overline-size = 2
overline-color = ${colors.white}
underline-size = 4
underline-color = ${colors.white}

;override-redirect = true
;wm-restack = i3


[module/i3]
type = internal/i3

pin-workspaces = false
strip-wsnumbers = true
index-sort = false 
enable-scroll = false

format = <label-state> 
format-padding-right = 2

label-unfocused-foreground = #8a7f8f
label-unfocused-padding = 1

label-focused-foreground = #c16772
label-focused-padding = 1

label-urgent-foreground = #e4b226
label-urgent-padding = 1


[module/filesystem]
type = internal/fs

; Mountpoints to display
mount-0 = /

label-mounted =  %free%
format-mounted-padding = 2

; Seconds to sleep between updates
; Default: 30
; interval = 10

; Display fixed precision values
; Default: false
fixed-values = true

; Spacing between entries
; Default: 2
spacing = 6




[module/filesystem2]
type = internal/fs

; Mountpoints to display
mount-0 = /media/<my_name>/Data

label-mounted =  %free%
format-mounted-padding = 2

; Seconds to sleep between updates
; Default: 30
; interval = 10

; Display fixed precision values
; Default: false
fixed-values = true

; Spacing between entries
; Default: 2
spacing = 6





[module/cpu]
type = internal/cpu

interval = 1

format = <label>
format-padding = 2

label =  %percentage%%


[module/memory]
type = internal/memory

interval = 1

format = <label>
format-padding = 2

label =  %gb_used% (%percentage_used%%)


[module/temperature]
type = internal/temperature

interval = 1

thermal-zone = 0

warn-temperature = 74

format = <ramp> <label>
format-padding = 2

format-warn = <ramp> <label-warn>
format-warn-padding = 2

label = %temperature-c%

label-warn = %temperature-c%
label-warn-foreground = #e4b226

ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 


[module/date]
type = internal/date

interval = 1

date = %a %b %d, 
time = %H:%M:%S

date-alt = %A, %d %B %Y
time-alt = %H:%M:%S

format = <label>
format-padding = 2

label =  %date% %time%


[module/battery]
; Note - if battery isn't showing, try BAT0 or BAT1, etc.
type = internal/battery

full-at = 95

battery = BAT1
adapter = ACAD

poll-interval = 5

format-charging = <animation-charging> <label-charging>
format-charging-padding = 2

format-discharging = <ramp-capacity> <label-discharging>
format-discharging-padding = 2

format-full = <ramp-capacity> <label-full>
format-full-padding = 2

label-charging = %percentage%%

label-discharging = %percentage%%

label-full = %percentage%%

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-framerate = 500


[module/backlight]
type = internal/backlight

card = intel_backlight

format = <label>
format-padding = 2

label =  %percentage%%


[module/pulseaudio]
type = internal/pulseaudio
; List sinks via `pactl list sinks` and look at the Name field

sink = alsa_output.pci-0000_00_1b.0.analog-stereo
;interval = 1

format-volume-padding = 2
format-volume = <ramp-volume> <label-volume>
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 

format-muted-padding = 2
label-muted =  0%


[module/powermenu]
type = custom/menu

label-open =   

label-close = cancel

label-close-background = #000f0f0f
label-close-foreground = #ffeefc
label-open-padding-left = 4
label-open-padding-right = 3
label-close-padding = 3

menu-0-0 = lock
menu-0-0-exec = ~/scripts/lock.sh
menu-0-0-background = #000f0f0f
menu-0-0-foreground = #c05c47
menu-0-0-padding-right = 3

menu-0-1 = reboot
menu-0-1-exec = menu-open-1
menu-0-1-background = #000f0f0f
menu-0-1-foreground = #c05c47
menu-0-1-padding-right = 3

menu-0-2 = power off
menu-0-2-exec = menu-open-2
menu-0-2-background = #000f0f0f
menu-0-2-foreground = #c05c47
menu-0-2-padding-right = 3

menu-1-0 = reboot?  
menu-1-0-exec = reboot
menu-1-0-background = #000f0f0f
menu-1-0-foreground = #e4b226
menu-1-0-padding-right = 3

menu-2-0 = power off?  
menu-2-0-exec = poweroff
menu-2-0-background = #000f0f0f
menu-2-0-foreground = #e4b226
menu-2-0-padding-right = 3


[module/wireless-network]
type = internal/network

; Look at ifconfig for interface
interface = wlo1

format-connected = <label-connected>
format-connected-padding = 2

format-disconnected = <label-disconnected>
format-disconnected-padding = 2

label-connected =  %essid%

label-disconnected =  None

내 i3 구성은 다음과 같습니다

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:System San Francisco Display 10

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.


# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec gnome-terminal #i3-sensible-terminal
#start a browser
bindsym $mod+numbersign exec firefox

# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# 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 $ws3 "3:" 
set $ws4 "4:" 
#set $ws5 "5:<span font='SVGFont1 12' rise='-2000'>a</span>"
set $ws6 "6:"
set $ws7 "7:"
set $ws8 "8:"
set $ws9 "9:"
set $ws10 "10:"
set $ws11 "11:"
#set $ws1 "1" 
#set $ws2 "2" 
#set $ws3 "3" 
#set $ws4 "4" 
set $ws5 "5"
#set $ws6 "6"
#set $ws7 "7"
#set $ws8 "8"
#set $ws9 "9"
#set $ws10 "10"
#set $ws11 "11"

# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+Control+1 workspace $ws11

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
bindsym $mod+Shift+Control+1 move container to workspace $ws11


# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

set $bg-color            #44444480
set $inactive-bg-color   #44444480
set $text-color          #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color     #E53935
set $ws-focused-bg   #ffc553

# window colors
#                       border              background         text                 indicator
client.focused          $bg-color           $bg-color          $text-color          #00ff00
client.unfocused        $inactive-bg-color  $inactive-bg-color $inactive-text-color #00ff00
client.focused_inactive $inactive-bg-color  $inactive-bg-color $inactive-text-color #00ff00
client.urgent       $urgent-bg-color    $urgent-bg-color   $text-color      #00ff00

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
#   strip_workspace_numbers yes
#   status_command i3status
#   colors {
#          background $bg-color
#              separator #757575
##                                border             background         text
#          focused_workspace  $ws-focused-bg     $ws-focused-bg     $text-color
#          inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
#          urgent_workspace   $urgent-bg-color   $urgent-bg-color   $text-color
#       }
#}
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
exec compton -f -I 0.06 -O 0.6

#GAPS!!!
gaps inner 10
for_window [class=".*"] border pixel 0

#touchpad touch-ups:
exec_always "~/.config/i3/touchpad_options"

#key swaps:
exec_always ~/.config/i3/key_mappings

#media
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound

# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # decrease screen brightness

# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
#bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous

#HARRY'S COMMANDS:
#desktop background
exec_always feh --bg-fill ~/Pictures/desktop-photos/roundabout-darkened.png

#lock shortcut:
bindsym $mod+shift+x exec i3lock -c 222222

#set dpi for i3 toolbars
exec_always xrdb -merge ~/.Xresources
exec_always xrandr --dpi 120

편집: 문제 해결을 더 수행한 결과 문제가 Polybar 설치에 있다는 것을 발견했습니다. 터미널에서 실행하면 내부/i3에 대한 기본 지원이 없다는 메시지가 나타납니다. Polybar -v 명령은 다음을 제공했습니다.

polybar 3.3.0-101-gf0c65e6

Features: +alsa +curl -i3 +mpd +network(libnl) +pulseaudio +xkeyboard

이것이 정확히 가이드(위에 링크됨, Fedora에 i3wm을 설치하기 위한 것이라고 주장함)에서 내가 받아야 한다고 말하는 출력이지만, -i3은 (논리적으로) i3 지원이 부족하다는 것을 의미하는 것처럼 보입니다(참조:https://github.com/polybar/polybar/issues/526). 설치를 올바르게 수행하는 방법을 정확히 모르지만 Polybar를 제거하고 설치 수행 방법에 대한 더 나은 문서를 찾아보겠습니다.

답변1

Ubuntu 18.04에서도 동일한 문제가 발생했습니다(작업 공간이 표시되지 않음). 그 이유는 libjsoncpp-dev기본 패키지 저장소가 너무 오래되었기 때문입니다(1.7.4 대 1.7.7). cmake 출력에 주의를 기울여야 합니다. 버전이 너무 오래된 경우 정적 라이브러리의 최소 필수 버전을 자체적으로 빌드합니다. 이게 내가 먼저 얻은 거야

./build.sh
...
-- Checking for module 'jsoncpp>=1.7.7'
--   Requested 'jsoncpp >= 1.7.7' but version of jsoncpp is 1.7.4
You may find new versions of jsoncpp at https://github.com/open-source-parsers/jsoncpp
-- Could not find jsoncpp>=1.7.7 -- building static lib...
-- JsonCpp Version: 1.7.7

그런 다음 권장 URL을 따라 최신 버전 1.9를 다운로드하고 설치한 다음 시스템 저장소에서 패키지를 제거하고 ./build.sh. 그러면 나는 얻는다

-- Checking for module 'jsoncpp>=1.7.7'
--   Found jsoncpp, version 1.9.0

하지만 다시 시작한 후에도 작업공간 ID가 여전히 표시되지 않습니다.

편집하다 보니 당연히 i3 모듈을 활성화해야 했습니다. 샘플 Polybar 구성의 일부는 아니지만 올바르게 수행되었는지 문제가 있습니다. 나는해야한다

...
modules-left = i3
...

그러면 수동으로 설치하지 않아도 정상적으로 작동합니다 jsoncpp. 좋아요!

답변2

같은 문제가 있어서 해결했습니다. 일부 Polybar 구성에서는 기본 이름으로 호출되지 않으면 작업공간을 볼 수 없습니다.

1:i3 구성에서 각 작업 공간의 이름을 , 2:등으로 지정했습니다. 내 문제를 해결하기 위해 각 작업 공간 이름을 기본 이름 1등 으로 재정의했습니다 2.

관련 정보