我刚刚从默认的i3栏切换到使用polybar (运行Fedora 30,i3-间隙)。我按照下面的指南安装了多边形: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 =
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//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 =
format-padding = 2
label = %percentage%%
[module/memory]
type = internal/memory
interval = 1
format =
format-padding = 2
label = %gb_used% (%percentage_used%%)
[module/temperature]
type = internal/temperature
interval = 1
thermal-zone = 0
warn-temperature = 74
format =
format-padding = 2
format-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 =
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 =
format-charging-padding = 2
format-discharging =
format-discharging-padding = 2
format-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 =
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-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 =
format-connected-padding = 2
format-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:a"
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编辑:做了一些更多的疑难解答,并发现问题是在我安装的多边形。如果我从终端运行它,它会告诉我,我没有内置的内部/i3支持。命令polybar -v提供给我:
polybar 3.3.0-101-gf0c65e6
Features: +alsa +curl -i3 +mpd +network(libnl) +pulseaudio +xkeyboard尽管这正是Fedora上的i3wm安装指南(链接到上面)告诉我应该得到的输出,但-i3 (逻辑上的)意味着它缺乏i3支持(ref:https://github.com/polybar/polybar/issues/526)。我不知道如何正确地执行安装,但我将卸载多边形,并寻找一些更好的文档,如何做它。
发布于 2019-11-09 21:45:25
我在Ubuntu18.04上也有同样的问题(没有显示工作区)。原因是主包回购中的libjsoncpp-dev太旧(1.7.4vs1.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,安装了它,从系统repos中删除了包,重新运行了./build.sh。然后我得到
-- Checking for module 'jsoncpp>=1.7.7'
-- Found jsoncpp, version 1.9.0但是在重新启动时,工作区ID仍然没有出现:(
当然,编辑结果是我必须激活i3模块。它不是示例polybar配置的一部分,而是正确完成的问题。我需要
...
modules-left = i3
...然后,它工作良好,甚至w/o手动安装jsoncpp。好的!
发布于 2023-01-29 16:43:23
也有同样的问题并修复了它。在某些多边形配置中,如果不按默认名称调用工作区,则无法看到它们。
我在您的i3配置中看到,您将每个工作区命名为:1:、2:等等。为了解决我的问题,我将每个工作区名称重新定义为默认名称:1、2等。
https://unix.stackexchange.com/questions/531049
复制相似问题