I’ve installed KDE Plasma Desktop 6.2.5-1, and my Desktop is set to use the “Folder View.” The thing is, I’m more of a keyboard guy, and I’d like to be able to navigate through my folders and files on the desktop when I minimize (Ctrl+D) without having to click on the desktop.
To achieve this, I came up with a script that runs when my session starts:
#!/bin/env python
from os import system, popen
from time import sleep
# Window dimentions
dimensions = [int(dimention) for dimention in popen("xdotool getdisplaygeometry").readlines()[0][:-1].split(" ")]
# Wainting for kwin
TIME = 0.4
while len(popen("ps aux | grep kwin_x11 | grep -v grep").readlines()) < 1:
sleep(TIME)
sleep(TIME)
# Minimize everything, click on corner and restoring position
system(f"xdotool key Super_L+d")
system(f"xdotool mousemove { dimensions[0] } 0 click 1")
system(f"xdotool mousemove { dimensions[0]//2 } { dimensions[1]//2 }")
Basically, it clicks on the desktop when the session starts, which gives me the behavior I’m looking for. However, this feels like a bit of a hack, and I was wondering if there’s a setting I’m missing that would allow me to achieve this more cleanly.
Actually, I have played with that before, and none of the focus options give me the desired behavior. It actually looks like it’s not just about focus. Look at this:
1.- I stopped the previously mentioned script.
2- Restarted my computer.
3.- Opened a terminal and entered the following command:
sleep 5 && xdotool getwindowfocus getwindowname
4.- Minimized everything (Ctrl+D).
5.- Waited 5 seconds.
6.- Maximized the terminal to check the result, which was:
Desktop @ QRect(0,0 1920x1080)
The focus is on the desktop when my session starts; however, I have to click on it if I want to navigate.
Isn’t it missing the last focused window then? I’m not really sure I get the question of this topic really. The way I understand is that you want to start a session and use the keyboard to navigate through existing but minimized windows by using the keyboard only?
If so, maybe you could try to assign a window ID to start with. Maybe along the lines of: 1) get to the desktop 2) for good measure: xdotool key F5 3) to save the window you wanna start with:
myWindow=“$(xdotool getactivewindow)”
4)to start it up:
xdotool windowactivate “$myWindow”
I have set my desktop to use ‘Folder View.’ I want to select folders and files using the arrow keys. When I press the arrow keys right after logging in, nothing happens; I have to click on the desktop to be able to select an item with the arrows. I created the script above, which runs automatically at the start of the session, and basically, it clicks on the desktop when the session begins. This allows me to select desktop items with the arrows, and it works like this until I log out and log back in. The script has solved the issue, but it feels like a bit of a hack, so I’m wondering if there’s a setting I might be missing. I also verified with xdotool that the desktop is the focused and active window when the session starts.