DK Window Manager

Happy to help if I can. My end, when i get home I’ll do an AL/DK install on different hardware and see what happens …

You’ll need to grab the latest source and build a debug executable

cd ~
git clone https://bitbucket.org/natemaia/dk
cd dk
make clean && make debug

Now you can edit your startup to redirect the output to a log file

exec ~/dk/dk > ~/dk.log 2>&1

Try to do as little as possible to create the issue and post the logfile. I don’t have a lot of faith I’ll get useful info from it but you never know.

Just a heads up.

On my alpine install, on different hardware, both issues I reported exist with DK1.7. Both are resolved with DK1.8.

I’m having issues getting the debug version running on my laptop (which uses SDDM as opposed to startx on alpine). I’ve run out of time now and it will probably be next week before I can continue with this. Debug version runs fine on Alpine and creates a debug file with entries.

2 Likes

Good to know, I’m not sure what the deal is. Could be similar to an issue cog was having with borders pre-1.8, it was a simple add to fix it but I need to know where it’s happening.

Yea, you can definitely just do a sudo make install after the initial make debug, though I’m not sure where the info would be output. Maybe the system xorg log (/var/log/Xorg.0.log) or you’re local one if it’s being run as a user (~/.local/share/xorg/Xorg.0.log), or perhaps sddm has their own log location.

It’s also fairly quick to switch to startx temporarily, I can help if you decide to go this route.

Hi Nate,

I actually have switched to startx and the problems completely go so it’s something to do with SDDM/ my SDDM setup.

I’m happy with not using SDDM, but I guess it would be beneficial for you to get to the bottom of this…?

I can’t get the debug version running and redirecting output to the log file. SDDM uses a .desktop file located at /usr/share/xsessions. (I’ve tried sudo make install - did you imply that it will output to a dk.log somewhere without specifically redirecting it). Anyway . . . working on it as time permits.

@icebird I don’t think I’ll be doing much more in the way of layouts, dwm layouts can be fairly easily ported with a bit of knowledge. As far as centered master you can already achieve something like it with a few tweaks to the settings, by changing the number of windows allowed in the master and each stack as well as the split ratios. It’s not perfect as you’ll need to adjust things everytime you open a new window but this could likely be scripted. But to be honest it’s not too hard with a few keystrokes adjusting the tile layout to suit.

e.g. From the default tile layout you can do

alt+shift+d - twice                (decrease stack1 to one window)
alt+i                              (increase master windows)

# possibly make a bind for this, you can also just resize with the mouse
dkcmd set msplit=0.26 ssplit=0.68  (set the split ratio close enough)

profit

The dynamic and resizable tile layout really makes a lot of other layout obsolete imo.

1 Like

Thank you so much Nate
It was just what I was looking for just like xmonad or dwm
now i don’t need dwm or xmonad

2 Likes

No sweat man, I’ll have to look into sddm and see if I can find anything. Thanks for the heads up.

@natemaia Hi, I wonder how a sticky window can become normal again (none sticky)

dkcmd win stick
dkcmd win unstick # lol

1 Like

Gone munger on notify-senting :disguised_face:

#### Screenshot and Selection Capture ####
super + Print
     scrot -q 100 -c -d 4 '$a_%s.png' -e 'mv $f ~/Pictures/ArchLabs/scrots/' && notify-send 'Screenshot Taken'

# screenshot and selection capture
{_,alt + }@Print
	scrot {_,-s} && notify-send 'Capture Taken'


#### Reload & Restart ####

# reload sxhkd
super + shift + p
	pkill -USR1 -x sxhkd && notify-send 'sxhkd reloaded'

# reload dkrc
super + shift + r
	dkcmd reload && notify-send 'dkrc reloaded'

# restart dk
super + ctrl + shift + r
	dkcmd restart && notify-send 'dkrc restarted'

# Media volume controls

XF86AudioRaiseVolume
    amixer set Master 5%+ && notify-send 'Volume Up'

XF86AudioLowerVolume
    amixer set Master 5%- && notify-send 'Volume Down'

XF86AudioMute
    amixer set Master toggle && notify-send 'Volume Muted'
3 Likes

stick is actually a toggle similar to fullscreen and float. It will either use the active window or you can pass a window ID.

Ho yeah, didn’t realize, my bad

1 Like

Frequently I see some sxhkdrc examples that really need less fat or bloat and people don’t realize its power, so here’s an example of what you can do with.
Instead of:

# move window, signed (+/-) for relative changes
alt + shift + {h,j,k,l}
    dkcmd win resize {x=-20,y=+20,y=-20,x=+20}

# resize window, signed (+/-) for relative changes
alt + ctrl + {h,j,k,l}
    dkcmd win resize {w=-20,h=+20,h=-20,w=+20}

So now we can script a little bit, let’s call it dk_winresize.

#!/bin/sh

# move/resize window, signed (+/-) for relative changes
# -m=move -r=resize ($1) direction ($2)
# change size to whatever you like.

size=20

case "$1" in
    -m) case "$2" in
            Left ) dkcmd win resize x=-"$size" ;;
            Down ) dkcmd win resize y=+"$size" ;;
            Up   ) dkcmd win resize y=-"$size" ;;
            Right) dkcmd win resize x=+"$size" ;;
        esac
    ;;
    -r) case "$2" in
            Left ) dkcmd win resize w=-"$size" ;;
            Down ) dkcmd win resize h=+"$size" ;;
            Up   ) dkcmd win resize h=-"$size" ;;
            Right) dkcmd win resize w=+"$size" ;;
        esac
    ;;
esac

and now shortcuts can be:

# resize/move window using custom script
alt + {shift + ,ctrl + }{h,j,k,l} # edited
    dk_winresize -{r,m} {Left,Down,Up,Right}

Am I wrong? :upside_down_face:

3 Likes

Cool idea.

I generally try to keep it simple and avoid confusion from people less familiar with sxhkd. I’m not sure I agree with the fat/bloat though, adding 10+ lines of script to manage instead of 2 lines in the sxhkdrc.

There is also the problem that you overwrote the alt+j/k focus binds, should be

alt + {shift + ,ctrl + }{h,j,k,l}

The nested cases are basically identical aside from the x/y/w/h so we could shorten it a bit

size=20 ver="h" hor="w"

case "$1" in
    -m) ver="y" hor="x" ;;
    -r) ver="h" hor="w" ;;
esac

case "$2" in
	Left)  dkcmd win resize "$hor"=-"$size" ;;
	Right) dkcmd win resize "$hor"=+"$size" ;;
	Up)    dkcmd win resize "$ver"=-"$size" ;;
	Down)  dkcmd win resize "$ver"=+"$size" ;;
esac
3 Likes

Well, I agree that bloat or whatever would be too much, just to say it’s better to keep config files short. Nice trick in the script

true

1 Like

Hi Nate. Both of these issues still exist - but intermittently. This is on my archlabs install with the latest dk1.8 using startx. I’ll re-enable logging/reboot and wait for it to happen again. Really weird.

Seems like a sync issue especially if it’s intermittent. Lot of crap with work piled on this week so I haven’t been working on dk. Might have time tonight or this weekend. Cog has also brought up an issue, and there’s a couple new ones open on Bitbucket so I’ve got a bit of catching up to do.

I’m not sure how useful my debug info will be for issues like this but I won’t turn it down.

@natemaia One thing I noticed and that’s not an issue, is when I move a tiled window (surrounded by others) the same way as if it was a floating one with:

dkcmd win resize y=+20

It moves in the stack like:

dkcmd win mvstack up

Strange but good to know (version 1.8) :upside_down_face:

I’m not sure what you mean myself anyway. ? :floppy_disk:

y and x are coordinates not sizes so yes, this is intentional behaviour. The mvstack command isn’t really used in the default sxhkdrc because the resize command works with tiled and floating windows and has more functionality. Pretty sure mvstack actually just calls resize under the hood with a y value of +10 or -10 based on the direction XD. TBH I should probably just ditch mvstack one day.