This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Enhanced Task Switcher

Tags: None
(comma "," separated)
sint
Registered Member
Posts
2
Karma
0

Enhanced Task Switcher

Wed Feb 22, 2023 10:18 pm
Hey, I'm trying to create a more confortable task switcher which is actually more inline with Gnome/Mac behaviour but I'm hitting a wall with kwin/qml so thinking what I want might not be possible without changes in KDE so opening this up to ideas/discussion because maybe there's a creative solution with the avalaible options.

What I'm trying to achieve is captured in the gif below demonstrating the following:
  • Use Alt + Tab/Backtick (`) to navigate through icons
  • Mouse hover each icon to select
  • Maintain ability to cycle windows with Alt + ` (backtick/grave)
  • Hit Q to fully close the application

Image


I have been able to take the existing task switcher MediumRounded and modify it to allow a hover state and also navigate with tab/backtick with the following snippets:

main.qml
Code: Select all
Keys.onPressed: {
  if (event.key == 81) {
    print("Q Pressed")
    // I'm sure it's possible to kill an application but I havnt got that far yet
  }
  if (event.key == 96) {
    print("tild Pressed")
    icons.decrementCurrentIndex();
  }
}

IconTabBox.qml
Code: Select all
MouseArea {
  anchors.fill: parent
  hoverEnabled: true
  onEntered: {
    iconsListView.currentIndex = index;
  }
}

However now the problem is this breaks switching windows with Alt + ` as there's a conflict in shortcuts because cycling application with Alt + Tab/Backtick will then switch windows and cause the tab switcher to close. There needs to be a way to detect if the task switcher is open when using Alt + ` to cycle windows.

Also it would be ideal if cycling through windows didnt bring up another task switcher menu as is the default since with application centric behaviour all of the icons in the window switching menu are all the same so makes it pointless.

I understand this behaviour is new to a lot of Linux users and can be hard to understand so I'll try go explain in more detail if needed but here's a quick snippet I posted on reddit of how I use the workflow:
The application-centric flow allows me to have most windows fullscreen with quick access/oranization. So for myself I'll have something like Sublime with 3 or 4 windows open filling the full desktop (and each window being a project) and then I'll use alt + ` to cycle through them instantly like a project switcher. Same goes for Chrome instead of having a 100 tabs I'll organize projects into windows and again cycle through them. This then allows me to have both apps at max window size with quick switching between Sublime/Chrome with alt + tab and then cycle the windows with alt + `, hardly moving my fingers.
sint
Registered Member
Posts
2
Karma
0

Re: Enhanced Task Switcher

Thu Feb 23, 2023 12:32 am
Pretty sure I posted this in the wrong category but now cant delete to move the post so if a mod could help out that would great. Should probably be in "KDE Frameworks & Development".


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]