DK doesn't seem to set _NET_DESKTOP_NAMES correctly

Issue #33 resolved
John Hoffmann created an issue

This breaks polybar. I’m sure it was working a few months ago when I tried DK, and I’ve tried going back several commits and doing a build, so I’m not entirely sure it’s a DK issue.

❯ xprop -root _NET_DESKTOP_NAMES
_NET_DESKTOP_NAMES(UTF8_STRING) = "Desktop", "1", "2", "3", "4", "1", "2", "3", "4", "5", ""

And my dkrc:

#!/bin/sh

logfile="$HOME/.dkrc.log"

if hash sxhkd >/dev/null 2>&1; then
    pkill sxhkd
    sxhkd -c "$HOME/.config/dk/sxhkdrc" &
fi

# ~/bin/polybar-dk &

border_width=2
border_outer_width=1

{
    # initialize 10 workspaces (1-10) (default: 1/monitor)
    dkcmd set numws=10

    dkcmd set ws=_  apply layout=tile master=1 stack=3 gap=24 msplit=0.6 ssplit=0.6

    dkcmd set ws=7  layout=grid pad left=200 right=200 top=100 bottom=100 gap=50
    dkcmd set ws=8  layout=tile master=3
    dkcmd set ws=9  layout=tile master=3
    dkcmd set ws=10 layout=tile master=3

    mon1='DisplayPort-0'
    mon2='HDMI-A-0'
    dkcmd set static_ws=true \
        ws=1  mon=$mon1 \
        ws=2  mon=$mon1 \
        ws=3  mon=$mon1 \
        ws=4  mon=$mon1 \
        ws=5  mon=$mon1 \
        ws=6  mon=$mon1 \
        ws=7  mon=$mon1 \
        ws=8  mon=$mon2 \
        ws=9  mon=$mon2 \
        ws=10 mon=$mon2

    dkcmd set focus_open=true focus_urgent=true focus_mouse=true
    dkcmd set tile_tohead=0 tile_hints=false
    dkcmd set win_minwh=50 win_minxy=10
    dkcmd set smart_gap=true smart_border=false
    dkcmd set mouse mod=super move=button1 resize=button3
    dkcmd set obey_motif=true

    dkcmd set border width=$border_width outer_width=$border_outer_width \
        colour \
        focus='#6699cc' \
        unfocus='#444444' \
        urgent='#ee5555' \
        outer_focus='#222222' \
        outer_unfocus='#222222' \
        outer_urgent='#222222'

    dkcmd rule class="obs" ws=9

    dkcmd rule class="scratchpad" float=true focus=true stick=true
    dkcmd rule class="Galculator" float=true focus=true
    dkcmd rule class="Bitwarden" ws=7

    dkcmd rule class="^(pavucontrol|steam|lxappearance)$" float=true

    dkcmd rule apply '*'

} >> "$logfile" 2>&1

if grep -q 'error:' "$logfile"; then
    hash notify-send && notify-send -t 0 -u critical "dkrc has errors" \
        "$(awk '/error:/ {sub(/^error: /, ""); gsub(/</, "\<"); print}' "$logfile")"
    exit 1
fi

exit 0

Comments (10)

  1. Nate Maia repo owner

    This is very strange, have you tried setting the names explicitly? Can you post the output of dkcmd status type=full num=1

  2. John Hoffmann reporter
     dkcmd status type=full num=1
    # globals - key: value ...
    numws: 10
    smart_border: 0
    smart_gap: 0
    focus_urgent: 1
    focus_mouse: 1
    focus_open: 1
    tile_hints: 0
    tile_tohead: 0
    win_minxy: 10
    win_minwh: 50
    active_window: 0x0180000e
    static_ws: 1
    obey_motif: 1
    
    # width outer_width focus urgent unfocus outer_focus outer_urgent outer_unfocus
    border: 2 1 0xff6699cc 0xffee5555 0xff444444 0xff222222 0xff222222 0xff222222
    
    # number:name:layout ...
    workspaces: 1:1:tile 2:2:tile 3:3:tile 4:4:tile 5:5:tile *6:6:tile 7:7:grid 8:8:tile 9:9:tile 10:10:tile
            # number:name active_window nmaster nstack msplit ssplit gappx smartgap padl padr padt padb
            1:1 0x00000000 1 3 0.60 0.60 16 0 0 0 0 0
            2:2 0x00000000 1 3 0.60 0.60 16 0 0 0 0 0
            3:3 0x00000000 1 3 0.60 0.60 16 0 0 0 0 0
            4:4 0x00000000 1 3 0.60 0.60 16 0 0 0 0 0
            5:5 0x00000000 1 3 0.60 0.60 16 0 0 0 0 0
            6:6 0x0180000e 1 3 0.60 0.60 16 0 0 0 0 0
            7:7 0x00000000 1 3 0.60 0.60 50 0 200 200 100 100
            8:8 0x0200000a 3 3 0.60 0.60 16 0 0 0 0 0
            9:9 0x00000000 3 3 0.60 0.60 16 0 0 0 0 0
            10:10 0x00000000 3 3 0.60 0.60 16 0 0 0 0 0
    
    # number:name:workspace ...
    monitors: *1:DisplayPort-0:6 2:HDMI-A-0:8
            # number:name active_window x y width height wx wy wwidth wheight
            1:DisplayPort-0 0x0180000e 0 0 2560 1440 0 24 2560 1416
            2:HDMI-A-0 0x0200000a 2560 0 1440 2560 2560 24 1440 2536
    
    # id:workspace ...
    windows: 0x00800023:6 *0x0180000e:6 0x0200000a:8
            # id title class instance ws x y width height bw hoff float full fakefull fixed stick urgent above hidden scratch callback trans_id
            0x00800023 "natemaia / dk / issues / #33 - DK doesn't seem to set _NET_DESKTOP_NAMES correctly — Bitbucket - qutebrowser" "qutebrowser" "qutebrowser" 6 16 40 2524 1380 2 0 0 0 0 0 0 0 0 0 0 none 0x00000000
            0x0180000e "tmux" "scratchpad" "scratchpad" 6 659 318 1241 797 2 0 1 0 0 0 1 0 0 0 0 none 0x00000000
            0x0200000a "#comfyui | AI Revolution - Discord" "discord" "discord" 8 2576 40 1404 2500 2 0 0 0 0 0 0 0 0 0 0 none 0x00000000
    
    # title class instance workspace monitor float full fakefull stick ignore_cfg ignore_msg focus callback x y width height xgrav ygrav
    rule: "(null)" "^(pavucontrol|steam|lxappearance)$" "(null)" -1 (null) 1 0 0 0 0 0 0  -1 -1 -1 -1 none none
    rule: "(null)" "Bitwarden" "(null)" 7 (null) 0 0 0 0 0 0 0  -1 -1 -1 -1 none none
    rule: "(null)" "Galculator" "(null)" -1 (null) 1 0 0 0 0 0 1  -1 -1 -1 -1 none none
    rule: "(null)" "scratchpad" "(null)" -1 (null) 1 0 0 1 0 0 1  -1 -1 -1 -1 none none
    rule: "(null)" "obs" "(null)" 9 (null) 0 0 0 0 0 0 0  -1 -1 -1 -1 none none
    
    # id:monitor ...
    panels: 0x01e00006:HDMI-A-0 0x01e00004:DisplayPort-0
            # id class instance monitor x y width height left right top bottom
            0x01e00006 "Bar" "lemonbar" HDMI-A-0 2560 0 1440 24 0 0 24 0
            0x01e00004 "Bar" "lemonbar" DisplayPort-0 0 0 2560 24 0 0 24 0
    

    I did try setting explicit names in my dkrc, though it had no effect. It is very strange, as there’s no reference to ‘Desktop’ in your source code!

    #!/bin/sh
    
    logfile="$HOME/.dkrc.log"
    
    if hash sxhkd >/dev/null 2>&1; then
        pkill sxhkd
        sxhkd -c "$HOME/.config/dk/sxhkdrc" &
    fi
    
    # ~/bin/polybar-dk &
    succade &
    
    border_width=2
    border_outer_width=1
    
    {
        dkcmd set numws=10
    
        dkcmd set ws=_  apply layout=tile master=1 stack=3 gap=16 msplit=0.6 ssplit=0.6
    
        dkcmd set ws=7  layout=grid pad left=200 right=200 top=100 bottom=100 gap=50
        dkcmd set ws=8  layout=tile master=3
        dkcmd set ws=9  layout=tile master=3
        dkcmd set ws=10 layout=tile master=3
    
        mon1='DisplayPort-0'
        mon2='HDMI-A-0'
        dkcmd set static_ws=true \
            ws=1  name="1" mon=$mon1 \
            ws=2  name="2" mon=$mon1 \
            ws=3  name="3" mon=$mon1 \
            ws=4  name="4" mon=$mon1 \
            ws=5  name="5" mon=$mon1 \
            ws=6  name="6" mon=$mon1 \
            ws=7  name="7" mon=$mon1 \
            ws=8  name="8" mon=$mon2 \
            ws=9  name="9" mon=$mon2 \
            ws=10 name="10" mon=$mon2
    
        dkcmd set focus_open=true focus_urgent=true focus_mouse=true
        dkcmd set tile_tohead=0 tile_hints=false
        dkcmd set win_minwh=50 win_minxy=10
        dkcmd set smart_gap=false smart_border=false
        dkcmd set mouse mod=super move=button1 resize=button3
        dkcmd set obey_motif=true
    
        dkcmd set border width=$border_width outer_width=$border_outer_width \
            colour \
            focus='#6699cc' \
            unfocus='#444444' \
            urgent='#ee5555' \
            outer_focus='#222222' \
            outer_unfocus='#222222' \
            outer_urgent='#222222'
    
        dkcmd rule class="obs" ws=9
    
        dkcmd rule class="scratchpad" float=true focus=true stick=true
        dkcmd rule class="Galculator" float=true focus=true
        dkcmd rule class="Bitwarden" ws=7
    
        dkcmd rule class="^(pavucontrol|steam|lxappearance)$" float=true
    
        dkcmd rule apply '*'
    
    } >> "$logfile" 2>&1
    
    if grep -q 'error:' "$logfile"; then
        hash notify-send && notify-send -t 0 -u critical "dkrc has errors" \
            "$(awk '/error:/ {sub(/^error: /, ""); gsub(/</, "\<"); print}' "$logfile")"
        exit 1
    fi
    
    exit 0
    

  3. John Hoffmann reporter

    I found an old reddit post (half of the thread was from deleted users) where a user was having a similiar issue with xmonad and tracked it down to xfsettingsd, let me try disabling that.

  4. John Hoffmann reporter

    That was it, removing xfsettingsd from my .xsession resolved the issue. Unsure why I was running that, might have been to set some application defaults, we’ll see how it goes.

  5. Nate Maia repo owner

    Ok that sounds more like it, definitely had me confused for a bit. What distro are you using? unless you're running xfce applications I would suggest uninstalling xfsettingsd. For theming you can use lxappearance and everything else can be handled in a desktop agnostic config.

  6. John Hoffmann reporter

    Arch, but I have several XFCE apps like Thunar and was trying to set the default applications to open filetypes with (4 different web browsers for example). Tyvm for the help, you can close this ticket as ‘user issue’

  7. Log in to comment