Picture-in-picture mode in dwm?
Date: 2020-10-17
One of the best feature I envy from Elementary OS is the picture in picture mode. With just one shortcut you can take any window, make it float and put it into a corner. I recently started watching some series, and it would be nice to have that feature, so when I work or doing something else, I can watch the video.
At first I thought about some complicated script. Making a window floating is not hard, it's built into dwm. You can also resize it with your mouse. However I would love to use the keyboard only.
The first patch that I applied is the sticky patch. It makes the active window appear on all tags with the MOD+s shortcut. Works really well, easy to apply to (watch out for some dwm.c lines if you have a heavily patched dwm).
The second patch, I started searching for something that moves and resizes windows. There are many patches, like aspectresize, which can resize fairly well (and keep the aspect ratio, perfect for movies).
Or moveplace, that simple makes the selected window 1/3 in size in both vertically and horizontally and can put the window into any corner, side or even in the middle. Unfortunately I am not a wizard, so I couldn't modify the the size of the window, because I would have liked to be a little bit bigger.
I ended up with the patch, moveresize, which can move and resize with keyboard. While I am not a fan of using the arrow keys, it looks like the best solution for now.
The ideal solution would be, one shortcut that puts the window at certain size, to a certain coordinate on the screen. There is probably an easier solution for this, but I am not a programmer.
This was day 79 of #100DaysToOffload.