i3: Duplicate workspace numbers
I’m submitting a…
[x] Bug [ ] Feature Request [ ] Documentation Request [ ] Other (Please describe in detail)
Current Behavior
Fresh when login with one single monitor, the workspace #1 will appear. When selecting workspace number 1 (Alt +1), a separate workspace will be presented with the associated icon I have defined in the config file. Both workspaces (#1 without icon and #1 with icon) will be displayed. “Iconless” workspace is only possible to select with the mouse pointer.
The “iconless” workspace disappears when no other window in the workspace is open.
Expected Behavior
Only 1 single workspace per associated number is presented (Alt +1 -> namespace #1). No duplicate numbers are shown.
Reproduction Instructions
- Login fresh i3 provided a configuration with namespaces associated with icons.
- Open a window in the landing workspace (workspace 1)
- Issue Alt+1 and a new “workspace 1” with the associated icon will be displayed.
Environment
Output of i3 --moreversion 2>&-
:
Binary i3 version: 4.20.1 (2021-11-03) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.20.1 (2021-11-03) (pid 1912)
Loaded i3 config:
/home/manuel/.config/i3/config (main) (last modified: Wed 04 May 2022 11:46:47 AM EEST, 5444479 seconds ago)
The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: x-sessio/i3
Config file
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 Mod1
Font for window titles. Will also be used by the bar unless a different font
is used in the bar {} block below.
font pango:InconsolataGo NF 11
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 i3-sensible-terminal
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+i focus up bindsym $mod+l 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+i move up bindsym $mod+Shift+l 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 mode focus_toggle
focus the child container
#bindsym $mod+d focus child
Focus parent container
bindsym $mod+Shift+u focus parent
Focus in the next sibling
bindsym $mod+Shift+n focus next
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 $ws0 0 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
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 $ws0
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 $ws0
Start certain applications in specific workspaces
assign [class=“Slack”] $ws4
Bug with Spotify that prevents from assigning the WS normally
https://github.com/i3/i3/issues/2060
for_window [class=“Spotify”] move to workspace $ws9 assign [class=“Emacs”] $ws3
workspace 1 output primary workspace 2 output primary workspace 3 output primary workspace 4 output primary workspace 5 output primary workspace 0 output eDP1
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 odiaeresis 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”
Start i3bar to display a workspace bar (plus the system information i3status
finds out, if available)
bar { # Icons from Awesome Font https://fontawesome.com/icons?d=gallery # Debug bar 2>/tmp/i3blocks.err /usr/bin/i3blocks -vvv -c ~/.config/i3/i3blocks.conf | tee /tmp/i3blocks.out
font pango: DejaVu Sans Mono, Font Awesome 5 Free Solid 12
status_command i3blocks -c ~/.config/i3/i3blocks.conf
position top
workspace_buttons yes
colors {
background #20293A
statusline #aaaaaa
separator #566E9C
# class | border | background | text |
#-------------------|---------|--------------|---------|
focused_workspace #20293A #20293A #ffffff
active_workspace #ff8c00 #20293A #ffffff
inactive_workspace #20293A #20293A #aaaaaa
urgent_workspace #20293A #20293A #FCF5C7
}
tray_output primary
}
Pulse Audio controls (mic control not tested)
set $refresh_i3status killall -SIGUSR1 i3status bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
External Keyboard
bindsym F6 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status bindsym F5 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status bindsym F7 exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status bindsym F4 exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
Sreen brightness controls (laptop only)
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
Media player controls
bindsym F10 exec playerctl play-pause bindsym F11 exec playerctl previous bindsym F12 exec playerctl next
Multi-screen screenshots with scrot
bindsym --release Print exec scrot ‘screenshot_%Y%m%d_%H%M%S.png’ -e ‘mkdir -p ~/pics/screenshots && mv $f ~/pics/screenshots && xclip -selection clipboard -t image/png -i ~/pics/screenshots/ls -1 -t ~/pics/screenshots | head -1
’ # All screens
OSX-like area selection screenshots
bindsym --release Shift+Print exec scrot -s ‘screenshot_%Y%m%d_%H%M%S.png’ -e ‘mkdir -p ~/pics/screenshots && mv $f ~/pics/screenshots && xclip -selection clipboard -t image/png -i ~/pics/screenshots/ls -1 -t ~/pics/screenshots | head -1
’ # Area selection
Toggle bluetooth listening/speaking
Script in /usr/local/bin
bindsym F9 exec audio_toggle.sh
# Lock screen behaviour
bindsym $mod+shift+Pause exec --no-startup-id i3lock-fancy
set $Locker kbdlight && i3lock-fancy && sleep 1
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, ® reboot, (Shift+s) shutdown mode “$mode_system” { bindsym l exec --no-startup-id $Locker, mode “default” bindsym e exec --no-startup-id i3-msg exit, mode “default” bindsym s exec --no-startup-id systemctl suspend, mode “default” bindsym h exec --no-startup-id §systemctl hibernate, mode “default” bindsym r exec --no-startup-id systemctl reboot, mode “default” bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode “default”
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Delete mode “$mode_system”
Autolock
exec --no-startup-id xautolock -locker i3lock-fancy -nowlocker i3lock-fancy -time 3 &
Keyboard shenanigans
exec --no-startup-id ibus-daemon
Keyboard layouts
exec --no-startup-id setxkbmap -model pc105 -layout fi,es -variant qwerty -option grp:alt_space_toggle,ctrl:swapcaps
Wallpaper
exec_always --no-startup-id ~/.local/bin/fehbg
Setup screen
exec --no-startup-id ~/.screenlayout/home.sh
Network manager tray
exec --no-startup-id connman-gtk --tray
Bluetooth applet
exec --no-startup-id blueman-applet
Power manager
exec --no-startup-id mate-power-manager
Logfile URL:
NB!: The configuration provided substitutes the icons associated with the workspaces as the browser does not recognize such.
- Linux Distribution & Version:
$ cat /proc/version
Linux version 5.18.0-2-amd64 (debian-kernel@lists.debian.org) (gcc-11 (Debian 11.3.0-3) 11.3.0, GNU ld (GNU Binutils for Debian) 2.38.50.20220615) #1 SMP PREEMPT_DYNAMIC Debian 5.18.5-1 (2022-06-16)
- Are you using a compositor (e.g., xcompmgr or compton):
Not using a compositor.
I open this bug as per request in https://github.com/i3/i3/issues/4238#issuecomment-1117230894
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (7 by maintainers)
Thanks for the instructions. I tried them out, and I think they confirm what I had already mentioned:
The workspace assignment (
workspace 1 output primary
) is the problem.Change it to
workspace "$ws1" output primary
(and so on) and the default workspace will show up as you intend it to.You can read more about this at https://i3wm.org/docs/userguide.html#workspace_screen