Comments (6)
I just ran into the same "problem" and trying to figure it out. I've also been looking for alternatives to j4-dmenu-desktop that could print available programs from .desktop to standard output, but to no avail so far.
from j4-dmenu-desktop.
There is a command line utility to introspect .desktop files written in Python by an Arch Linux guy, hosted on Github. Don't remember the name, though, but you may be able to find it.
from j4-dmenu-desktop.
While I took a stab at #51, I remembered this.
This should work, mostly:
#!/bin/sh
CURPID=$$
STDOUT=$(readlink -f /proc/$CURPID/fd/1)
j4-dmenu-desktop --dmenu="(cat > $STDOUT) | (cat << EOF)" &> /dev/null
It relies on some conventions, i.e. readlink -f resolving symlinks, /proc/$PID, and that FD 1 of a shell process is the active standard output. You'll need to put this in a script and run that.
The other way around is possible, too
j4-dmenu-desktop --dmenu="(cat &> /dev/null) | (echo '$*')"
($*
= all arguments passed to the shell script, but really, any variable works)
With this it should be quite possible to integrate j4-dmenu-desktop with practically any kind of menu. #48
from j4-dmenu-desktop.
Wow, I have not expected this 👍
I have tried your script and it nicely prints out list of application names to the console, but when combined with rofi it - strangely - does not work :(
Something is telling me that it might be the case of output redirection, but I am not able to prove it...
from j4-dmenu-desktop.
Hm, this should be transparent if the shell script is run like a shell script in a separate shell process. I don't know Rofi, maybe it documents somewhere how exactly it implements these modis.
Edit: Rofi appears to be a C program, so I'd expect it uses a proper shell process to execute scripts handed to it.
from j4-dmenu-desktop.
I will report this issue to Rofi's developer, he might be interested.
from j4-dmenu-desktop.
Related Issues (20)
- Options to configure font and colors HOT 3
- How can I show command names instead of desktop entry names? HOT 5
- J4dd leaves zombies behind when using --wait-on HOT 1
- Cannot compile j4-dmenu-desktop due to CMake Error HOT 2
- Add tag to application names to find them faster HOT 3
- Can you change the font size? HOT 4
- Cannot open display error HOT 4
- Shell processes left in the background HOT 2
- Sorting by display name case insensitively HOT 3
- Addtional .desktop file folders HOT 1
- Add .clang-format file
- Consider using a library for argument handling
- Upgrade Catch HOT 1
- Add i3 native support + deprecate --wrapper HOT 1
- Reimplement #137
- Add GitHub actions
- Signed releases HOT 10
- Add contributing help
- Consider switching to C++17 HOT 1
- Reconsider history
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 j4-dmenu-desktop.