Comments (9)
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.
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.
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.
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.
@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.
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.
~/.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.
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.
That directory is already 'used' by rofi to auto-load mode scripts. You might want to avoid using that.
from rofi.
Related Issues (20)
- Ability to *replace* the list in combi mode via a script HOT 8
- [REQUEST] Internal API to access drun desktop entry cache from other modes HOT 1
- [REQUEST] generic file/entry preview HOT 10
- Incorrect display of text for too long strings when displaying a message in the "Error message" HOT 6
- [BUG] Empty keybind arguments appear to be skipped HOT 9
- [BUG] Commands launched in 'run' mode are duplicated in history, enclosed in quotes. HOT 4
- How to make an item/row permanent? HOT 1
- How to make text in item/row visible but not being searched in -dmenu?
- [BUG] rofi filebrowser does not reliably list all directory entries on remote filesystems HOT 4
- [BUG] Stop quoting entries in history when running them HOT 5
- [REQUEST] filter mode option HOT 2
- [REQUEST] Sort combi modes option HOT 4
- [BUG] rofi crashes with SIGSEGV HOT 40
- [REQUEST] HOT 2
- [BUG] Icon fetcher fails to load icons/thumbnails for animated GIFs HOT 4
- [BUG] Rofi can't show icons of desktop entries when the desktop entry contains a path for the icon HOT 25
- [BUG] run mode does not update with new files in $PATH when run from a keybind (e.g. from sxhkd) HOT 4
- [BUG] Segfault somewhere in PCRE on archlinux HOT 5
- [BUG] Setting cursor-color has no impact on the Rofi application launcher. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rofi.