多个桌面无法在bspwm中工作|bspwmrc未被读取



我使用的是带有Gnome桌面环境的Ubuntu 20.04.1 LTS。

几天前,我决定尝试一下bspwm,它运行良好,除了一件事。。。我不能使用多个桌面(类似于windows中的工作区(。我研究了一下,现在看来bspwm一开始并没有阅读我的bspwmrc。

我已经将我的配置放置为{HOME}/.config/bspwm/bspwmrc{HOME}/.config/sxhkd/sxhkdrc,它们都是可执行文件。

在某些地方,我发现提到了xinitrc,但我没有在那里配置任何内容。我的主目录中一开始没有xinitrc。我在这里找到了一个/etc/X11/xinit/xinitrc,上面写着:-

#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
. /etc/X11/Xsession

我把它复制到我的主目录,并添加了几行。现在它读到:-

#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
#. /etc/X11/Xsession
sxhkd &
exec bspwm

我的bspwmrc文件(目前没有被btw读取(是这样的:-

#! /bin/sh
pkill sxhkd
sxhkd &
pkill compton
compton &
pkill feh 
feh --randomize --bg-fill ~/Pictures/Wallpapers/ &
pkill polybar
polybar example
bspc monitor -d 1 2 3 4 5 6 
bspc config border_width         2
bspc config window_gap          12
bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true
bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a Chromium desktop='^2'
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

如果我运行这个

bspc monitor -d 1 2 3 4 5 6

在终端中,我可以在顶部栏上看到这些桌面,并可以轻松地在它们之间切换。

但问题是,为什么我的bspwmrc一开始就没有被bspwm读取??请帮忙!!

编辑:我注意到我的bspwmrc正在被bspwm读取,因为每当我试图对我的bspwmrc进行一些更改时(在这种情况下,我在bspwmrc文件中使用了feh配置(,除了监视器之外,所有这些更改都会被反映出来!!

请帮我解决这个问题。

我在Reddit上找到了答案。要了解所有信息,请查看以下内容。

我将eDP-1添加到我的bspc监视器行,现在它是:-

bspc monitor eDP-1 -d I II III IV V VI VII VIII IX X

但即使这样也无济于事,所以我尝试在的帮助下从bspwmrc记录stderr

set -xv
exec 2>>/tmp/bspwm.log

我发现问题实际上出在我的polybar配置上(我刚刚复制了默认的polybar-config,现在有了"polybar example"(,因此bspwmrc的其余部分没有完全读取。polybar配置生成了这样的错误,

polybar|warn:  Dropping unmatched character  (U+e0ca) in ''
polybar|warn:  Dropping unmatched character  (U+e016) in ''
polybar|warn:  Dropping unmatched character  (U+e10c) in ''

所以,在我开始我的polybar之前,我只是移动了bspc显示器线,然后它工作得很好。现在,我的bspwmrc是这个,

#! /bin/sh
set -xv
exec 2>>/tmp/bspwm.log
bspc query -M --names
bspc monitor eDP-1 -d I II III IV V VI VII VIII IX X
pkill sxhkd
sxhkd &
pkill compton
compton &
pkill feh 
feh --randomize --bg-fill ~/Pictures/Wallpapers/ &
pkill polybar
polybar example
bspc config border_width         2
bspc config window_gap          12
bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true
bspc rule -a Gimp desktop='^8' state=floating follow=on
bspc rule -a Chromium desktop='^2'
bspc rule -a mplayer2 state=floating
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

现在我只需要稍微调整一下我的polybar配置,它也会很好地工作。

最新更新