GithubHelp home page GithubHelp logo

Comments (15)

qewer33 avatar qewer33 commented on June 25, 2024 2

I have done some work on this and it does seem doable but Plasma's global shortcut system is kind of weird. You can't delete shortcuts registered by KWin scripts easily (the easiest way is to log out, open tty and delete the entries from KWin's shortcut config file) and I haven't found a way to read keypresses/assign shortcuts without using registerShortcut

So for now I may keep this on hold until I find a better way to implement this (or KWin's shortcut registering system gets fixed)

from exquisite.

Zetaphor avatar Zetaphor commented on June 25, 2024 1

+1 to this suggestion. I came across this amazing extension while looking for a Linux alternative to Windows' Fancy Zones tool.

In that tool I have my layouts bound to LCTRL+META+LALT+Number. When I switch layouts it shows me an overlay of the layout and then you can SHIFT+Drag windows into each snap zone.

Do you have any suggestions on how to get started with Qt/Kwin? I'd like to see this functionality implemented (the overlay and shift dragging into zones) and I'm willing to take a crack at it.

Exquisite is the closest I've found so far to being able to replicate that functionality, thank you for creating this!

from exquisite.

qewer33 avatar qewer33 commented on June 25, 2024 1

@Zetaphor , the link thomasfinstad provided is nice for getting started and the API reference covers a lot of useful things (although not everything sadly, it still lacks quite a bit of stuff, I also recommend you check out sources of popular KWin scripts)

That being said, someone in my reddit post mentioned that a similar feature to Powertoys' Fancy Zones was already being developed for KWin (https://invent.kde.org/plasma/kwin/-/merge_requests/2560), might want to take a look at that effort and see if you can help

from exquisite.

imthenachoman avatar imthenachoman commented on June 25, 2024 1

Is it possible to call Exquisite from a command line? If so, add a feature where you can resize a window by calling Exquisite from the command line, and then users can add their own application shortcuts. For example:

exquisite --file 0.qml --window 2

And this says to size the current/active window to the 2nd object in the windows array of the 0.qml file. And:

exquisite --file 0.qml

Would resize all windows.

This would be the easiest/fastest way cause Exquisite wouldn't have to worry about shortcut management.

from exquisite.

Zetaphor avatar Zetaphor commented on June 25, 2024 1

@imthenachoman This seems like the best approach, as it would also make window tiling easily scriptable

from exquisite.

qewer33 avatar qewer33 commented on June 25, 2024

Quite a cool idea but I'm not sure how I would find shortcuts to assign to every single default layout window without clashing with commonly used shortcuts. Could use the number keys maybe, any ideas?

from exquisite.

thomasfinstad avatar thomasfinstad commented on June 25, 2024

I think the best way would be to either just add a silly complicated set of hotkeys by default or, what I think is better, add them as options but don't add any default bindings. A compromise could be nothing by default and an optional configuration parameter in the layout config itself where you add the hotkey-able part you can also add a default binding for that hotkey.

I'm on mobile right now so in psedu config under the window position, maybe something like:

  • shortcut_enable
  • shortcut_default_binding=meta+ctrl+1

from exquisite.

thomasfinstad avatar thomasfinstad commented on June 25, 2024

@Zetaphor I am not the author of the kwin script, and don't know anything about it really, but I bet this will be a fine place to get started: https://develop.kde.org/docs/extend/plasma/kwin/

from exquisite.

Asteroid33 avatar Asteroid33 commented on June 25, 2024

I was thinking that will be good if after a window is tiled, automatically select the other window and maybe arrange in the layout selected. I don't know if it's possible.

from exquisite.

qewer33 avatar qewer33 commented on June 25, 2024

This is another great idea but sadly impossible (without a complete rewrite) due to the very nature of Exquisite being a KWin script. KWin scripts can't be invoked as executables.

from exquisite.

zelch avatar zelch commented on June 25, 2024

Hm, is there any way to make a kwin script receive dbus calls?

Because that would allow us to do stuff with dbus calls.

from exquisite.

zelch avatar zelch commented on June 25, 2024

So far, with a reasonable amount of digging, I'm sadly not convinced that this is possible without some extremely ugly hacks.

Because I can't see any way to trigger a function or signal from dbus and have it be received by a KWin script.

The only real option I see would be creating an 'API' where a new window with the correct title would be seen as an instruction for Exquisite, and that's way too much of a hack for me to ever want to do.

It is possible to register shortcuts, but not to list them or delete them.

Hm, alright, I have one less ugly idea:

Have Exquisite register shortcuts for window preset 0 - 9, defaulting to no shortcuts, and add a valid field in the layout files to say that a given window position should be assigned to a given shortcut number.

This will obviously work poorly if the same preset is claimed by more than one window position, but it's the best I can think of right now.

from exquisite.

imthenachoman avatar imthenachoman commented on June 25, 2024

@zelch You are talking about global shortcuts, that are available even when Exquisite is not visible, right? I like that idea. That is what I did with https://github.com/imthenachoman/ExquisiteW.

from exquisite.

zelch avatar zelch commented on June 25, 2024

@imthenachoman That was the thought.

I'm not entirely happy with the idea, simply because I really don't have a good answer for how to handle multiple windows in the layouts trying to claim the same shortcut number, but so far it's about the only option I can think of which we can actually implement.

from exquisite.

imthenachoman avatar imthenachoman commented on June 25, 2024

@zelch No issues. It's not a big deal for me personally. I'm happy with everything as is. As soon as the two bugs I mentioned are pushed, I'll be good to go. :)

from exquisite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.