GithubHelp home page GithubHelp logo

ww-run-raise's Introduction

ww. Utility to raise or jump an applications in KDE. It interacts with KWin using KWin scripts and it is compatible with X11 and Wayland. It also works with multiple screens. It is intended as a wmctrl alternative (only for the raising windows part) compatible with wayland.

Installing

  • Download ww from this repository
  • Copy ww into your path. e.g.:
cp ww /usr/local/bin

Feel free to rename it

Usage

ww only works in KDE. It works in X11 and Wayland.

Example

if you want to raise or jump to an open firefox window:

ww -f firefox -c firefox

if you want to raise or jump to an app with an specific class:

ww -f kitty.terminal -c 'kitty --class kitty.terminal'

Note: In this example kitty allows you to pass the class option that sets the window class. This is a kitty feature, not a ww feature.

If you want to raise any window that matches a title. JS regexp allowed:

ww -fa 'Zoom meeting'

Paramaters:

-h  --help                show this help
-f  --filter              filter by window class
-fa --filter-alternative  filter by window title (caption)
-c  --command             command to check if running and run if no process is found

Create shortcuts

You can use KDE custom shortcuts to add a custom shortcut that calls ww

image

How does it work?

Internally ww uses 2 main things to work: pgrep and "on demand" KWin scripts.

When you run, for example ww -f firefox c -firefox, ww tries to find a process running with the exact command:

pgrep -o -f firefox

This detects if the application is running or not.

Then ww creates a file inside ~/.wwscripts to store a temporary kwin script, it loads the script, runs it, stops it and unloads it in a single go.

The kwin script is targeted to find and focus a specific window.

TODO

Here some ideas of improvements that I'd like to explore, but my knowledge on kwin scripts doesn't allow me:

  • Do not depend on pgrep to detect if an application is open?
  • Use a single kwin script with signals instead of loading and running one each time?

ww-run-raise's People

Contributors

academo avatar volt4ire avatar

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.