Closed omnigenous closed 1 month ago
No. Check the wiki on external modules/plugins.
If you tell me what exactly you want to achieve, i'll could tell you what to do with Walker.
Well I was looking for wofi replacements. I have huge list (1-2 thousands entries) of unicode symbols and I want to make searchable menu to select them, wofi takes like an entire minute to load that list.
Actually I wanted to do something similar.
For OP, I assume that something like this should work.
"external": [
{
"name": "symbols",
"prefix": "s",
"src": "cat /path/to/the/list",
"cmd": "wl-copy"
}
],
However, the downside is that it re-executes every time you type anything, which is terrible for performance. I would like to see an option to only execute a command once when entering an external module. For example, in my config I added following command
"src": "zoxide query --list",
"cmd": "kitty %RESULT%"
It works, but it also executes zoxide on the input and passes the input string through stdin, which is unnecessary. I only want to filter the initial entries inside the walker.
Ah yes, I understand. I guess Walker needs a "src_once" for those cases.
Ok, i've added 2 things: src_once
and src_once_refresh
. Feel free to try it out and report back. Example:
"external": [
{
"name": "symbols",
"prefix": "s",
"src_once": "cat /path/to/the/list",
"src_once_refresh": false,
"cmd": "wl-copy"
}
],
src_once_refresh
would be needed if you run Walker as a service and need to update the cached result when opening Walker in order to avoid stale data.
I've tried this with a nearly 5k lines emoji list and it works fast. The slowest part is actually rendering the list in GTK, but i just introduced a variable max_entries
that defaults to 50, so only max 50 entries will be rendered. Adjustable in config of course, i personally set it to 25.
... i've just added an emoji module.
... i've just added an emoji module.
walker v0.0.94
walker -m emojis
walker is just blank
Okay, had to replace my config with default one: https://github.com/abenz1267/walker/blob/master/config/config.default.json
"modules": [
{
"name": "runner",
"prefix": ""
},
{
"name": "applications",
"prefix": ""
},
+ {
+ "name": "emojis",
+ "switcher_exclusive": true
+ },
{
"name": "ssh",
"prefix": "",
"switcher_exclusive": true
},
{
"name": "finder",
"prefix": "",
"switcher_exclusive": true
},
{
"name": "commands",
"prefix": "",
"switcher_exclusive": true
},
{
"name": "websearch",
"prefix": "?"
},
{
"name": "switcher",
"prefix": "/"
}
]
Okay, I have tried creating external module but I'm getting exit satus 1
Maybe something triggers it in my list?
I've added
{
"name": "gh",
"prefix": "+",
"src_once": "cat /home/andrej/Downloads/list.txt",
"cmd": "notify-send \"%RESULT%\""
}
To my config with your list and it works fine.
... i've just added an emoji module.
walker v0.0.94
walker -m emojis
walker is just blank
Okay, had to replace my config with default one: https://github.com/abenz1267/walker/blob/master/config/config.default.json
"modules": [ { "name": "runner", "prefix": "" }, { "name": "applications", "prefix": "" }, + { + "name": "emojis", + "switcher_exclusive": true + }, { "name": "ssh", "prefix": "", "switcher_exclusive": true }, { "name": "finder", "prefix": "", "switcher_exclusive": true }, { "name": "commands", "prefix": "", "switcher_exclusive": true }, { "name": "websearch", "prefix": "?" }, { "name": "switcher", "prefix": "/" } ]
Yeah, the module still needs to be configured!
I've added ... To my config with your list and it works fine.
cat ~/Downloads/list.txt
won't work but cat /home/user/Downloads/list.txt
or cat $HOME/Downloads/list.txt"
will.
Is there any reason it is that way? Can we fix it? $HOME
is good enough just wondering if it can be more clear and flexible.
I've added ... To my config with your list and it works fine.
cat ~/Downloads/list.txt
won't work butcat /home/user/Downloads/list.txt
orcat $HOME/Downloads/list.txt"
will. Is there any reason it is that way? Can we fix it?$HOME
is good enough just wondering if it can be more clear and flexible.
~
is a local shell expansion. Expanding it programmatically seems hacky to me...
Edit: i will expand it. Possible edge-case errors can be handled once they actually arrive. Otherwise using ~
seems rather "natural" to me....
... can this be closed?
... can this be closed?
Yeah if you are not interested in implementing dmenu-like mode. I can make my stuff work with external modules now.
I mean, if the use-cases can be solved by external modules i don't see the point of a special dmenu-mode, unless i'm missing something.
Personally I think dmenu-like mode where you can just pipe stuff into is simpler than setting up external module. For example I can write and test script in couple seconds to view clipboard history with wofi without having to edit configs and learning what that config can accept:
clipboard list | wofi -d -p "Clipboard" | wl-copy
Hm, i'm kinda torn. On the one side i can see the argument in terms of testing and familiarity... on the other side it wouldn't solve anything that can't be solved already.
Feel free to tryout clipboard list | walker -d | wl-copy
Awesome! I tried echo "c\nb\na\n100\n10\n44\n2" | walker -d
and I notice it sorted alphabetically (numbers are sorted wrong). I couldn't find an entry in config that affects sorting. Also would be nice to expose sorting setting to walker flags.
Other small thing, using cliphist list | wofi -d
works but with walker it doesn't remove index numbers. I haven't looked at wofi source code so not sure how it is done and if it is even a good idea to do. You can simply cliphist list | cut -f 2 | walker -d
How do I remove "Dmenu" at the bottom of each item in a list?
cmd_alt
was used with dmenu mode?-k, --keepsort
added => won't sort alphabetically-l, --labelcolumn
define which column to use as the label. The output will still be the actual value => see cliphist why (short: cliphist decode
needs the index)sub
anymore. kinda pointlessalt+enter
was used: could you show me how you'd use it? I'd pipe the result to f.e. stderr if alt+enter
is being used... would that help?for passing if alt+enter was used: could you show me how you'd use it?
I would use it for dirty one-liners, ex:
echo '1 hello\n2 world\n3 foo\n4 bar' | walker -d | isWalkerAltEnter && echo alt || echo normal
Not sure how it would look in bash, I'm not really competent :D
yeah... that won't work...
maybe i'm missing something. i'm not sure how i'd forward the information about what kinda action happened, other than doing something like cmd <result>
or cmd_alt <result>
where you then have to further process that information.
- Removing Index:
Testing with cliphist list | walker -d -k | cliphist decode
Walker will display just numbers, I do love new --labelcolumn
flag and have couple ideas where I could use it already, but I think I liked where I could see cliphist index so I know when my clipboard history becomes too big. How do I make walker display all columns?
On a side note, I haven't played with --labelcolumn
that much but do you think we might need --columnseparator
flag.
Ah fuck. I need to stop waking up and straight up fixing/adding things. I know whats happening.. will fix later today. Per default it should display everything. It's just buggy. Yeah, adding a separator would make sense.
No worries, thank you for your work <3
Should be fixed. --separator, -t
flag has been added. Example: -t 's'
or -t "'\t'"
echo "c\nb\na" | walker -d -k
Is this already possible and I'm doing this wrong?
echo "hello\nworld" | walker