parasurv@webspace ~ $

Blog: [Site updates] [Linux] [Free Software] [Culture] [Health] [Watches] Learning: [Emacs Journal] [Linux Wiki] Personal: [Contact] [About me]

Shorts: [Microblog] [Linkblog] Important: [Read] [Watch] [Listen] Other pages: [Old games stuff]

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.

Hosted on Neocities and created with Emacs, the world best text editor, operating system. This website doesn't track you. I don't use any javascript or other scripts. I don't store any information about the visitors. It's just pure old fashioned HTML. Some parts of the site is not up-to-date design wise. I may or may not update them in the future. I don't really support mobile stuff, but I bet if you disable the little CSS I have, you can read the site perfectly.