AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 452617
Accepted
mor3dr3ad
mor3dr3ad
Asked: 2018-06-30 03:07:09 +0800 CST2018-06-30 03:07:09 +0800 CST 2018-06-30 03:07:09 +0800 CST

i3wm:切换到工作区并将容器移动到(相同)工作区映射到不同的工作区

  • 772

大家好,

这个问题让我很难过:

当前行为

我的 i3 配置具有以下工作空间:

    bindsym $mod+grave workspace h0me
    bindsym $mod+1 workspace term1nal
    bindsym $mod+2 workspace co2e
    bindsym $mod+3 workspace teleg3am
    bindsym $mod+4 workspace edi4or

    bindsym $mod+Shift+grave move container to workspace h0me
    bindsym $mod+Shift+1 move container to workspace term1nal
    bindsym $mod+Shift+2 move container to workspace co2e
    bindsym $mod+Shift+3 move container to workspace teleg3am
    bindsym $mod+Shift+4 move container to workspace edi4or

我的 polybar 具有以下内容:

    ws-icon-0 = h0me;a
    ws-icon-1 = term1nal;b
    ws-icon-2 = co2e;c
    ws-icon-3 = teleg3am;d
    ws-icon-4 = edi4or;e

其中 a 到 e 是图标。

我希望 polybar 会在我切换到新工作区和将容器移到那里时显示名称旁边的项目(polybar 已相应配置)。

但是,当我将容器移动到新工作区时,polybar 只显示图标和名称。然后,此工作区不会映射到$mod+1; 我只能通过搜索或循环浏览所有工作区来切换到该工作区。

当我切换到工作区时,我得到一个同名但没有图标的新工作区。

此行为仅适用于工作区 1 到 3,所有其他工作区都相应地工作。

环境

输出i3 --moreversion 2>&-:

i3 版本:
我在带有 polybar 的 Arch linux 上运行 i3-gaps 版本 4.15.0.1。





日志文件网址:https://logs.i3wm.org/logs/5746196614217728.bz2
- Linux 发行版和版本:Arch Linux Kernel 4.17.2-1
- 您是否使用合成器(例如,xcompmgr 或 compton):compton

2018-06-27-144015_1920x1080_scrot

i3
  • 1 1 个回答
  • 3618 Views

1 个回答

  • Voted
  1. Best Answer
    Try431
    2018-06-30T07:56:30+08:002018-06-30T07:56:30+08:00

    您是否有理由通过 polybar 而不是 i3 配置文件映射这些图标?并不是说这样做有什么问题,我只是能够做你在 i3 中完全描述的事情:

    bindsym $mod+1 workspace 1: 
    bindsym $mod+2 workspace 2: 
    bindsym $mod+3 workspace 3: 
    bindsym $mod+4 workspace 4: 
    
    bindsym $mod+Shift+1 move container to workspace 1: 
    bindsym $mod+Shift+2 move container to workspace 2: 
    bindsym $mod+Shift+3 move container to workspace 3: 
    bindsym $mod+Shift+4 move container to workspace 4: 
    

    这些框是我直接复制/粘贴到配置文件中的字体很棒的图标。我决定我喜欢只用一个图标来描述工作区,因为我倾向于只在某些工作区上执行某些任务(例如,工作区 2 是网页浏览,工作区 3 是终端/代码编辑),但你也可以轻松地做你的“h0me图标”设置。

    也许将它转移到 i3 配置文件而不是通过 polybar 可能会得到你想要的结果。

    i3 设置示例

    编辑按要求,我附上了我的 polybar 配置文件:

    ;=====================================================
    ;
    ;   To learn more about how to configure Polybar
    ;   go to https://github.com/jaagr/polybar
    ;
    ;   The README contains alot of information
    ;
    ;=====================================================
    
    [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/example]
    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 filesystem2 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 = true
    strip-wsnumbers = true
    index-sort = true
    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
    
    • 1

相关问题

  • 从 i3 使用 gdmflexiserver 切换用户

  • 从命令行运行 i3 命令

  • Conky i3bar 无法识别空格

  • 如何配置 gdm 以登录到 sway 会话?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve