Giter Site home page Giter Site logo

Comments (9)

DaveDavenport avatar DaveDavenport commented on June 14, 2024

Can't you implement this easily using script mode and i3's ipc?
I wonder if we can help with the icon for an application in a way.
(looking up icon for window class would be easy, I wonder if we can implement something to fetch icon for window id).

from rofi.

arakis avatar arakis commented on June 14, 2024

Implementing via script mode and IPC would work, but as you said, I need an efficient and safe way to show the icons.

from rofi.

arakis avatar arakis commented on June 14, 2024

By the way, I also see that the original window list has some additional features/columns: Workspace number, and separate columns for Process name and Window Title.

So, it might be challenging to mimic this list one-to-one, solely for custom order.

from rofi.

arakis avatar arakis commented on June 14, 2024

There might be another issue with script mode: it can be quite slow, especially when running in notebook power-saving mode.

#!/usr/bin/env bash

# https://gist.github.com/Atreyagaurav/2b70bb997fa5eff45c924e86095080e8

$(jq -r '.scripts | .["'$(jq -r '.scripts|keys[]' \
                             ~/.config/rofi/scripts/custom-menu.json \
                              | rofi -dmenu)'"] |.script' \
     ~/.config/rofi/scripts/custom-menu.json)
{
  "bgcolor": "black",
  "scripts": {
    "rdp-arakis": {
      "name": "RDP Arakis",
      "script": "/home/sebastian/.scripts/launch-rdp-arakis.sh",
      "tooltip": "RDP Arakis"
    }
  }
}

When launching the aforementioned script, rofi will be displayed immediately - but it can take up to 2 seconds until the list is filled (in this case, a single entry), when in power save mode. When plugged into power, the list will be filled immediately.

In contrast to the window list: This mode will always be rendered immediately, without noticing any delay, regardless of the power mode.

For a window switcher, any delay will kill the user experience.

So, passing the order of window-id's via command line may still be the most performant way.

from rofi.

lbonn avatar lbonn commented on June 14, 2024

@arakis this may interest you: https://github.com/lbonn/i3-focus-last, it uses dmenu mode.

I am also working on a rofi plugin version (in the repo as well) which mostly works but still needs a bit of polish.

from rofi.

DaveDavenport avatar DaveDavenport commented on June 14, 2024

supprising that in power saving mode it is so slow.. I wonder why and if it has something to do with rofi's async loading in dmenu.

btw the above is not script mode? but dmenu mode. there is a (slight) difference.

from rofi.

DaveDavenport avatar DaveDavenport commented on June 14, 2024
~/.config/rofi/scripts/custom-menu.json

I am confused by this, rofi does not support json menus.
That directory should have script mode scripts.

from rofi.

arakis avatar arakis commented on June 14, 2024

You're right, rofi does not support json. It's just an input file for the jq tool. See https://gist.github.com/Atreyagaurav/2b70bb997fa5eff45c924e86095080e8

from rofi.

DaveDavenport avatar DaveDavenport commented on June 14, 2024

That directory is already 'used' by rofi to auto-load mode scripts. You might want to avoid using that.

from rofi.

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.