Git Product home page Git Product logo

walker's People

Contributors

abenz1267 avatar diniamo avatar eclairevoyant avatar errornointernet avatar flytaly avatar jdsee avatar mafrans avatar michaelbelsanti avatar schromp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

walker's Issues

External module configuration

Hey, thanks for this tool, this is great.

However, I'm encountering a config problem.
If I understand correctly, in the README you state that we can define external modules in two ways :

  • defining a script that returns a JSON list of Entry
  • defining a script that returns a list of String and using the transform and cmd properties

That said, I have the following config, trying the first way :

"external": [
        {
            "name": "code",
            "prefix": ">",
            "src": "nu ~/.config/walker/ext_code.nu"
        }
]

and a script that returns a list of JSON entries :

#!/usr/bin/env nu
def main [] {
    ls `~/.config/Code - OSS/User/workspaceStorage/**/workspace.json`
    | each {|f| (
        open --raw $f.name
        | from json
        | update folder {|row| $row.folder | str replace 'file://' '' }
        | insert label {|row| $row.folder | path basename }
        | insert sub {|row| $row.folder }
        | insert exec {|row| 'code-oss ' + $row.folder }
        | insert terminal {|row| false }
        | insert icon {|row| 'com.visualstudio.code.oss' }
        | insert history {|row| true }
        | insert searchable {|row| $row.label | path basename }
    )}
    | to json
    | print
}
[
  {
    "folder": "/home/blitz/.config",
    "label": ".config",
    "sub": "/home/blitz/.config",
    "exec": "code-oss /home/blitz/.config",
    "terminal": false,
    "icon": "com.visualstudio.code.oss",
    "history": true,
    "searchable": ".config"
  }
]

But reading your source code, it seems that most of the Entry properties are ignored or overwritten by the external module.

walker/modules/external.go

Lines 115 to 119 in f8c4eee

for k, v := range entries {
entries[k].Class = e.ModuleName
entries[k].Sub = e.ModuleName
entries[k].Exec = strings.ReplaceAll(e.cmd, "%RESULT%", v.Label)
}

So I have my list displaying (ignoring the custom sub), doing nothing on item selection (no cmd defined, exec ignored).

GTK error?

When I run walker from the terminal I see the following repeated error (every keystroke shows this error again):

ERROR gotk4_gbox_list_get_item: assertion 'index < objects_get_size(&self->items)' failed glib_old_log_api=1 priority=4

I am using the 0.0.44-1 version installed via yay.

Walker doesn't look like it should

Walker looks pretty messed up for me, as can be seen in these screenshots:
20240512_19h37m07s_grim
20240512_19h37m26s_grim

For reference, in order to get walker installed, I had to install gtk4-layer-shell like this:

paru -S --asdeps --mflags '--nocheck' gtk4-layer-shell

Ranking issues

Dolphin is oddly prioritized, and emacs still shows over element when searching for element.

image
image
image

Three options that would greatly improve ranking quality are

  1. Associate which strings are used to open which programs, e.g. "el" goes to "Element" over "Emacs" even if emacs is used far more often
  2. Increase weighting of connected characters in the search results ("em" in "EMacs" over "em" in "filE Manager")
  3. Increase weighting of the first connected string of characters more than subsequent ones ("l" goes to "Libreoffice" over "doLphin")

dmenu module?

Is this already possible and I'm doing this wrong?

echo "hello\nworld" | walker

Plugins: Render text when no results are found

  • Option to set user defined text to render in plugin (ex: "Nothing found. Press Enter to run ")
  • Flag to set no results text for when used in dmenu mode

Potential conflict when websearch module is enabled.

Execute different commands depending on key pressed

Real world example:

I have emoji list that I want to search and copy or open emojipedia.org for that emoji.

Solution:

Let the user define a cmd that will be executed if certain key is pressed, for example when Enter pressed execute cmd_ENTER if Shift+Enter is pressed execute cmd_SHIFT_ENTER. I'm not sure what more elegant implementation would be just throwing ideas.

Unexpected keybind behaviour when used with Hyprland.

When walker is called from shell it runs just fine.

If set to be executed from a keybind in Hyprland such as below:

bind = SUPER, R, exec, walker

It will fail to launch and result in a lockfile being made. I was able to work around it by instead doing:

bind = SUPER, R, exec, alacritty -e zsh -c walker

However it will also display the terminal it was ran in instead of hiding it like Clipse does when I run a similar bind setup for that. I didn't see anything in the readme or the wiki on the recommended way to configure it for use in Hyprland, so I'm just curious if i've misconfigured this or if this is a bug.

Walker can't find new applications

Currently, it seems that walker is caching the discovered .desktop applications in ~/.cache/walker/applications.json. This cache doesn't seem to be getting updated though, which means that if walker was installed before some other application, walker won't discover this new applications, unless this cache is manually deleted.

Perhaps walker could instead perform some kind of check each time it's started, just going over the directories that contain these .desktop appliation files, checking that there's no new entries. (Even just a hash based check of some kind would probably be sufficient).

I don't mind having to delete this cache file too much, however it could be confusing for people that aren't aware that this file exists and just aren't seeing newly installed applications, without knowing why. I don't mind if you make this a wontfix, but it should definitely be documented (at least in this github issue, but ideally in the readme too), for people that don't know about this caching behavior. That said, unless it would greatly increase startup times, I do think that it's a good idea to add this check.

Move nix files into a nix directory

The top level directory is getting quite cluttered with nix files. Even more so if my module pr gets merged.
It may make sense to move more files into a nix/ directory.

One downside i can see is that having the default.nix (for the package) and the shell.nix for developing inside the nix folder would make it more cumbersome for non flake users.
However, this repo is only packaged in flakes at the moment so most/all of the people that would utilize these files can do so through the flake.

As @diniamo is the one who implemented all the nix things until now he might have an opinion about this.

Weird behavior in dmenu mode

echo "c\nb\na" | walker -d
  • e, d, u, n or m matches everything
  • Pressing letter that matches history + tab completes from history, not useful in dmenu mode (ex: h + tab = hello)
  • Pressing arrow up puts f in search box doesn't happen with shift + tab

Many icons missing?!

There are many icons missing in the applications list. I don't know if it has anything to do with these errors?!

Screenshot_29-03-24_12-13

Walker duplicating app icons on hyprland

Duplicate apps

  • Hey, I have started using hyprland recently and just installed walker as an app launcher, for some reason the app launcher duplicates apps for some reason
    • Im using arch linux and i previously had KDE installed, idk how to fix this issue so help would be appreciated
      Here is a photo
      20240502_11h23m14s_grim

no applications?

No applications shown when launching walker

image

yet the other modes works as intended.

I don't get any logs when launching from terminal

runtime error: invalid memory address or nil pointer dereference

Getting this runtime error after packaging walker for Nix/NixOS.
startup time: 77.806913mspanic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: closure error: unexpected panic caught: runtime error: invalid memory address or nil pointer dereference

Closure added at:
	main.main at github.com/abenz1267/walker/main.go:81
	runtime.main at runtime/proc.go:271
	runtime.goexit at runtime/asm_amd64.s:1695
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5ce633]

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc0000aa390, {0xa845b1, 0x1b}, {0xc000040760, 0x1, 0x1})
	github.com/diamondburned/gotk4/pkg@v0.2.2/core/closure/funcstack.go:104 +0x908
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0xc0000aa390)
	github.com/diamondburned/gotk4/pkg@v0.2.2/core/closure/funcstack.go:122 +0xc5
panic({0x8ee540?, 0xe72230?})
	runtime/panic.go:770 +0x132
github.com/abenz1267/walker/processors.parse.func1({0xa82d7e, 0x18}, {0x0?, 0x0?}, {0x4e8d85?, 0x18?})
	github.com/abenz1267/walker/processors/applications.go:93 +0x73
path/filepath.Walk({0xa82d7e, 0x18}, 0xc000040b88)
	path/filepath/path.go:558 +0x4a
github.com/abenz1267/walker/processors.parse()
	github.com/abenz1267/walker/processors/applications.go:92 +0x23a
github.com/abenz1267/walker/processors.GetApplications()
	github.com/abenz1267/walker/processors/applications.go:37 +0x25
main.setupInteractions()
	github.com/abenz1267/walker/interactions.go:32 +0x78
main.activate(0xc00012e018)
	github.com/abenz1267/walker/main.go:153 +0x41f
reflect.Value.call({0x8b5b40?, 0xa921d0?, 0x18?}, {0xa7b398, 0x4}, {0xc00012e000, 0x1, 0xc00012e000?})
	reflect/value.go:596 +0xce5
reflect.Value.Call({0x8b5b40?, 0xa921d0?, 0xa0b000?}, {0xc00012e000?, 0x10?, 0xe8d1e0?})
	reflect/value.go:380 +0xb9
github.com/diamondburned/gotk4/pkg/core/glib._gotk4_goMarshal(0x2ba5e20, 0x0, 0x1, 0x7ffd88db4880, 0x4df985?, 0x2ba4550)
	github.com/diamondburned/gotk4/pkg@v0.2.2/core/glib/glib.go:294 +0x998
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x2ba4550, 0x1, 0x2ba5f50)
	_cgo_gotypes.go:13795 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x2ba4550, 0x1, 0x2ba5f50)
	github.com/diamondburned/gotk4/pkg@v0.2.2/gio/v2/gio.go:41611 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc0001bd4b8, {0xc000016060, 0x1, 0x1})
	github.com/diamondburned/gotk4/pkg@v0.2.2/gio/v2/gio.go:41611 +0x1f1
main.main()
	github.com/abenz1267/walker/main.go:83 +0x27e

Steps to reproduce: nix run github:donovanglover/nixpkgs/walker#walker

Expose placeholder settings to cli flags

Now we have dmenu mode (#47) would be nice to be able to change placeholder of walker with cli flag. Currently the only option is to create separate config file and pass it to --config flag.

-p | --placeholder

Example:

echo "chocolate\nvanilla" | walker -d -p "Pick you favorite ice cream"

Is there any other settings that could be exposed to cli flags which would be useful in combination with dmenu mode?

Lockfile breaks walker options

When walker --help is used it becomes impossible to use walker again without manually removing /tmp/walker.lock. Suggested fix:

  • Don't create a lockfile for options like --help
  • If there is a lockfile, users should still be able to use options like --help

SSH module wont parse SSH config

Starting v.0.1.6 ssh config should be parsed but in my case it is not. Launching walker from the terminal using walker -m ssh does not return any error message.

Only entries from known hosts appear in walker.

Here is my ~/.config/ssh

host server
HostName 192.168.10.12
Port 22
User username
identityFile ~/.ssh/id_ed25519_sk_key1
IdentityFile ~/.ssh/id_ed25519_sk_key2
RemoteForward /run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra 
RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /run/user/1000/gnupg/S.gpg-agent.ssh

I have multiple hosts but there are all configured the same. Simply different HostName , Port, and User.

[feature request] flatpak walker builds

  • with flaptaks there are no dependencies problems
  • flatpaks works same in all distros
  • if you providing flatpak builds, there are no need to build binaries for every single distro
  • flatpaks are main way to install apps on atomic distros, like fedora atomic, vanilla os, and steam os

External module cmd pipe

Doesn't work:

{
  "name": "test",
  "prefix": "t",
  "src_once": "echo '1 hello\n2 world\n3 foo\n4 bar'",
  "src_once_refresh": false,
  "cmd": "cut -d ' ' -f 2 | wl-copy",
  "cmd_alt": "echo"
}

Works:

echo '1 hello\n2 world\n3 foo\n4 bar' | walker -d | cut -d ' ' -f 2 | wl-copy

I would've just used dmenu mode but I want to also use cmd_alt and there no equivalent with dmenu mode afaik (#47 (comment))

--keepsort but for plugins

{
  "name": "test",
  "prefix": "t",
  "src_once": "echo \"c\nb\na\"",
  "cmd": "wl-copy"
}

^ Will be sorted alphabetically

Can we have keep_sort: boolean for plugins?

Panic if ssh known_hosts file does not exist

Walker currently panics with the following error if the ssh known_hosts file does not exist:

panic: open /home/tepri/.ssh/known_hosts: no such file or directory [recovered] panic: closure error: unexpected panic caught: open /home/tepri/.ssh/known_hosts: no such file or directory

I store my file in a different location (~/.config/ssh/known_hosts), some users may not use ssh at all.

No Keyboard Input

I am using Niri (https://github.com/YaLTeR/niri) and would love to use walker with it. I can successfully launch it, but I can only interact with the walker window using the mouse. There is no keyboard input at all in the walker window. If i run walker from the terminal the inputs just go behind it into the terminal window instead.

Expand environment variables

Currently, you have to provide the full path to your module. I propose replacing the environment variables in the path, so instead of

      "src": "node /home/username/path/to/myscript.js"

you can specify

      "src": "node $HOME/path/to/myscript.js"

Here is the commit, but I am not sure if there should be an additional option or if this is sufficient.

Binary cache miss, can't build on NixOS

I tried to install walker as instructed here, but when I build the new config, I get the output:

error: builder for '/nix/store/6xxbvl6y0n2cm3xhrv4x2ry5drplp8nc-walker-0.0.94.drv' failed with exit code 1;
       last 10 log lines:
       > Building subPackage .
       > # github.com/diamondburned/gotk4/pkg/glib/v2
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:15535:10: could not determine kind of name for C.g_date_time_new_from_unix_local_usec
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:15585:10: could not determine kind of name for C.g_date_time_new_from_unix_utc_usec
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:17060:10: could not determine kind of name for C.g_date_time_to_unix_usec
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:48:42: could not determine kind of name for C.g_dir_get_type
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:17177:4: could not determine kind of name for C.g_dir_unref
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:50:42: could not determine kind of name for C.g_hmac_get_type
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:9360:10: could not determine kind of name for C.g_log_writer_syslog
       > vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:60:42: could not determine kind of name for C.g_rand_get_type
       For full logs, run 'nix log /nix/store/6xxbvl6y0n2cm3xhrv4x2ry5drplp8nc-walker-0.0.94.drv'.
error: 1 dependencies of derivation '/nix/store/k39cmni8gmwh2n2kag8py0n0pspi87dy-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sggwkx0cl49lh3c6i6wh31z18w1l3x2d-walker.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/cybygidlnda7gpcckypcqawrdqa0dw3x-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pqp2fc9k29gxvw3dzyaxw5j3fclyvwiv-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q8i6bkzj7kvx24qqfavzp8vfj989ndr3-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qpyjn8kwqw1fqpa59nzm4fbisn3hvgnf-nixos-system-noah-24.11.20240714.693bc46.drv' failed to build

nix log /nix/store/6xxbvl6y0n2cm3xhrv4x2ry5drplp8nc-walker-0.0.94.drv:

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/b9yd20pc9c1b9ppijrq0sv8b6f0fwm0h-walker-source
source root is walker-source
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
Building subPackage .
# github.com/diamondburned/gotk4/pkg/glib/v2
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:15535:10: could not determine kind of name for C.g_date_time_new_from_unix_local_usec
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:15585:10: could not determine kind of name for C.g_date_time_new_from_unix_utc_usec
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:17060:10: could not determine kind of name for C.g_date_time_to_unix_usec
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:48:42: could not determine kind of name for C.g_dir_get_type
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:17177:4: could not determine kind of name for C.g_dir_unref
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:50:42: could not determine kind of name for C.g_hmac_get_type
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:9360:10: could not determine kind of name for C.g_log_writer_syslog
vendor/github.com/diamondburned/gotk4/pkg/glib/v2/glib.go:60:42: could not determine kind of name for C.g_rand_get_type

I have added the binary cache to my settings, so I shouldn't even need to build this locally.
Checking the cache with curl https://walker.cachix.org/6xxbvl6y0n2cm3xhrv4x2ry5drplp8nc.narinfo results in:

404 - Not Found

Give already used items higher search priority

Walker does already keep track of previously selected entries in it's history. This is currently used when showing the applications once walker is opened, without any user (search) input.

However, once I type something in to search, this history is disregarded completely and the search just shows the results based on the fuzzy matches ordering.

This is kind of annoying, as many other app launchers actually use the cached history and give the previously selected entries slightly more priority, which makes commonly used items a lot easier to search for quickly.

Plugins don't render

walker v0.3.1

"plugins": [
  {
    "name": "test",
    "prefix": "t",
    "keep_sort": true,
    "src": "echo \"c\nb\na\"",
    "cmd": "echo"
  },
  {
    "name": "calc",
    "prefix": "=",
    "src": "node ~/.config/walker/calc.cjs %TERM%"
  }
]

walker -m test
walker -m calc

Renders blank list, no error

Running walker and typing =2+2 works

Allow prefixes with multiple characters

Currently, prefixes can only consist of one character, which is very restrictive. And you cannot even use letters as prefixes, as every letter could be a prefix for some other application.

Also, this kind of prefixes should activate the plugin only if there is a space after the prefix, similar to how Alfred, popular Mac OS launcher, works. This way you won't miss other entries and can have unlimited plugins.

If the prefix is 1 character long, the behavior should probably remain the same, so you can still use things like "=3+3", "/app" e.t.c.

Invalid config file

If your config file is not valid json/toml/yaml then walker will always try to generate a new config file.
If your config file matches the default or WALKER_CONFIG_TYPE then you get an error message that the config already exits. If it doesn't match then walker will not print an error and just generate a new config file.

I think walker should print an error if the config is invalid and not try to generate a new config.

How to use the home manager module

My nixos flake use home manager as a module. Config:

{ 
	 home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true; 

          home-manager.users.karm2 = import ./home.nix;

 }

After struggling for a long time I still couldn't figure out where to add the imports to import the module walker.homeManagerModules.walker. I don't know how to avoid the error "the option home does not exist".
My flake:

{
  description = "A simple NixOS flake";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
    nixos-hardware.url = "github:NixOS/nixos-hardware/master";
    aagl.url = "github:ezKEa/aagl-gtk-on-nix";
    aagl.inputs.nixpkgs.follows = "nixpkgs";
    walker.url = "github:abenz1267/walker";
    fenix = {
      url = "github:nix-community/fenix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    lanzaboote = {
      url = "github:nix-community/lanzaboote/v0.3.0";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager = {
    #   url = "github:nix-community/home-manager/master";
    #   # The `follows` keyword in inputs is used for inheritance.
    #   # Here, `inputs.nixpkgs` of home-manager is kept consistent with
    #   # the `inputs.nixpkgs` of the current flake,
    #   # to avoid problems caused by different versions of nixpkgs.
      inputs.nixpkgs.follows = "nixpkgs";
    }; 
  };

  outputs = { self, nixpkgs, nixos-hardware, aagl, fenix, lanzaboote, home-manager, walker, ... }@inputs: {
    packages.x86_64-linux.default = fenix.packages.x86_64-linux.minimal.toolchain;
    nixosConfigurations.MKZFRMW = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ 
	{
	 imports = [ aagl.nixosModules.default ];
          nix.settings = aagl.nixConfig; # Set up Cachix
          programs.anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules
          programs.honkers-railway-launcher.enable = true;
        }
        ./configuration.nix
	./flatpak-fix.nix
	nixos-hardware.nixosModules.framework-13-7040-amd

	lanzaboote.nixosModules.lanzaboote

	({ pkgs, lib, ... }: {

            environment.systemPackages = [
              # For debugging and troubleshooting Secure Boot.
              pkgs.sbctl
            ];

            # Lanzaboote currently replaces the systemd-boot module.
            # This setting is usually set to true in configuration.nix
            # generated at installation time. So we force it to false
            # for now.
            boot.loader.systemd-boot.enable = lib.mkForce false;

            boot.lanzaboote = {
              enable = true;
              pkiBundle = "/etc/secureboot";
            };
        })
	({ pkgs, ... }: {
          nixpkgs.overlays = [ fenix.overlays.default ];
          environment.systemPackages = with pkgs; [
            (fenix.packages.${system}.complete.withComponents [
              "cargo"
              "clippy"
              "rust-src"
              "rustc"
              "rustfmt"
            ])
            rust-analyzer-nightly
          ];
        }) 
	home-manager.nixosModules.home-manager
        { 
	 home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true; 
          home-manager.users.karm2 = import ./home.nix;
        }
      ];
    };
  };
}

Allow user to cycle through list

echo "c\nb\na" | walker -d
  1. Select last item
  2. Press Arrow Down or Tab
  3. Nothing happens

Would be great to have an option to cycle through list so on step 3 selection goes back to item 1. Not necessary just for dmenu mode could be great when used with single module defined from plugin.

Allow user to submit even when no item selected

echo "c\nb\na" | walker -d
  1. Type something that won't match anything
  2. Let user submit whatever is in search box if flag is provided or plugin option is enabled

Maybe even make that default behavior for dmenu mode?

Add option to pass the input (%TERM%) via stdin

It'd be really neat if it was possible to pass the walker text input to given commad through stdin, instead of just having to use %TERM% there. This is because of the way shell escaping works, which makes it basically impossible to prevent injections.

For example, currently, a module like this:

    {
      "name": "test",
      "prefix": "!",
      "src": "echo '%TERM%'",
      "cmd": "notify-send 'test' '%RESULT%'"
    }

Does work, but only as long as the actual input doesn't contain '. After some messing around, it turns out there really is no good way at all to prevent injections/quote escaping like this in any way here. In fact, it gets even worse, if the src command is just: echo %TERM%, inputting "hi" will end up with just outputting hi, dropping the quotes entirely. This is a pretty big issue when the input needs some kind of special processing.

For a more real-world example, I wanted to make a custom web search module with duckduckgo, where I attempted doing this:

    {
      "name": "DDG search",
      "prefix": "*",
      "src": "jq --arg input '%TERM%' -n -r '$input | @uri'",
      "cmd": "xdg-open https://duckduckgo.com/?t=h_&q=%RESULT%&ia=web"
    }

The jq here is for url-escaping. However, if my prompt contains ', it would just end up messing up the command.

One way to at least improve this, though not entirely fix it, would be to only perform the replacements after splitting the command into arguments, so that the entire input term is always a single argument. (Though for backwards compatibility, or some special cases, where people don't want that, it might be better to introduce something like %SINGLETERM%).

That said, the best way would definitely be to just allow passing the term via stdin. Perhaps if there's no %TERM% in src, this could be the default, or just add another bool param for the modules, like pass_as_stdin.

Ideally, there should probably also be an option to do this for the cmd.

Plugin fails without "cmd"

{
  "name": "test",
  "prefix": "t",
  "src": "echo \"c\nb\na\""
}
walker -m test
invalid character 'c' looking for beginning of value

Walker window is blank

{
  "name": "test",
  "prefix": "t",
  "src": "echo \"c\nb\na\"",
+ "cmd": "cat"
}

^ Now it will run fine

I couldn't get calc plugin to work from wiki as well.

hyprctl executable not found

I don't use hyprland and despite being notified that the Hyprland module is being disabled I still get this error message every time I input something.

exec: "hyprctl": executable file not found in $PATH

If I launch walker with explicit modules I don't get this error
walker -m applications

I used default config.
walker version: 0.3.7

alternative AM key

I think it would be great to be able to use an alternative AM key, whether that be multiple options or just the option to use alt instead of control.

My muscle memory currently has me pressing control + A to select my search text and replace it, which is causing me to open apps by accident.

AUR build fails with cgo-gcc-prolog undefined reference

I've encountered an issue where the AUR package fails to build.
I wasn't sure if I should report this problem directly in the comment section of the AUR package, or here.
Considering that the problem has already been reported there, and the issue still persists, I thought I report it here.

The required dependency gtk4-layer-shell is installed on my system.
Trying to install the package from the AUR results in the following error:

╰─❯ paru -S --mflags '--nocheck' walker
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1) walker-0.1.0-1

:: Proceed to review? [Y/n]: Y

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
 nothing new to review
fetching devel info...
==> Making package: walker 0.1.0-1 (Sat 20 Jul 2024 03:18:51 PM CEST)
==> Retrieving sources...
  -> Found v0.1.0.tar.gz
==> Validating source files with sha256sums...
    v0.1.0.tar.gz ... Passed
==> Validating source files with b2sums...
    v0.1.0.tar.gz ... Passed
==> Making package: walker 0.1.0-1 (Sat 20 Jul 2024 03:18:52 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v0.1.0.tar.gz
==> Validating source files with sha256sums...
    v0.1.0.tar.gz ... Passed
==> Validating source files with b2sums...
    v0.1.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting v0.1.0.tar.gz with bsdtar
==> Sources are ready.
walker-0.1.0-1: parsing pkg list...
==> Making package: walker 0.1.0-1 (Sat 20 Jul 2024 03:18:53 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
WORK=/tmp/go-build2027708682
cd /home/void/.cache/paru/clone/walker
git status --porcelain
cd /home/void/.cache/paru/clone/walker
git -c log.showsignature=false show -s --format=%H:%ct
cat /home/void/.cache/go-build/66/663b97cc87f7e3b93191f89f1f600f0edb1d038db539faf8b1d6dc76b8c718c0-d  # internal
# github.com/diamondburned/gotk4/pkg/glib/v2
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_bookmark_file_get_type':
/tmp/go-build/cgo-gcc-prolog:499:(.text+0x500): undefined reference to `g_bookmark_file_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_checksum_get_type':
/tmp/go-build/cgo-gcc-prolog:1277:(.text+0xcb0): undefined reference to `g_checksum_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_date_time_get_type':
/tmp/go-build/cgo-gcc-prolog:2051:(.text+0x14a0): undefined reference to `g_date_time_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_dir_get_type':
/tmp/go-build/cgo-gcc-prolog:2641:(.text+0x1aa0): undefined reference to `g_dir_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_hash_table_get_type':
/tmp/go-build/cgo-gcc-prolog:3928:(.text+0x2820): undefined reference to `g_hash_table_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_hmac_get_type':
/tmp/go-build/cgo-gcc-prolog:4289:(.text+0x2b90): undefined reference to `g_hmac_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_io_channel_get_type':
/tmp/go-build/cgo-gcc-prolog:4778:(.text+0x3050): undefined reference to `g_io_channel_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_io_condition_get_type':
/tmp/go-build/cgo-gcc-prolog:5185:(.text+0x3470): undefined reference to `g_io_condition_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_key_file_get_type':
/tmp/go-build/cgo-gcc-prolog:5580:(.text+0x38f0): undefined reference to `g_key_file_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_main_context_get_type':
/tmp/go-build/cgo-gcc-prolog:6674:(.text+0x4350): undefined reference to `g_main_context_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_main_loop_get_type':
/tmp/go-build/cgo-gcc-prolog:6971:(.text+0x4600): undefined reference to `g_main_loop_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_mapped_file_get_type':
/tmp/go-build/cgo-gcc-prolog:7117:(.text+0x4750): undefined reference to `g_mapped_file_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_markup_parse_context_get_type':
/tmp/go-build/cgo-gcc-prolog:7294:(.text+0x4910): undefined reference to `g_markup_parse_context_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_match_info_get_type':
/tmp/go-build/cgo-gcc-prolog:7560:(.text+0x4bd0): undefined reference to `g_match_info_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_normalize_mode_get_type':
/tmp/go-build/cgo-gcc-prolog:7854:(.text+0x4e60): undefined reference to `g_normalize_mode_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_option_group_get_type':
/tmp/go-build/cgo-gcc-prolog:7920:(.text+0x4f00): undefined reference to `g_option_group_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_pattern_spec_get_type':
/tmp/go-build/cgo-gcc-prolog:8316:(.text+0x52d0): undefined reference to `g_pattern_spec_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_rand_get_type':
/tmp/go-build/cgo-gcc-prolog:8884:(.text+0x5800): undefined reference to `g_rand_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_regex_get_type':
/tmp/go-build/cgo-gcc-prolog:9344:(.text+0x5c80): undefined reference to `g_regex_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_source_get_type':
/tmp/go-build/cgo-gcc-prolog:10139:(.text+0x63e0): undefined reference to `g_source_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_strv_get_type':
/tmp/go-build/cgo-gcc-prolog:10599:(.text+0x67c0): undefined reference to `g_strv_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_time_zone_get_type':
/tmp/go-build/cgo-gcc-prolog:10748:(.text+0x6930): undefined reference to `g_time_zone_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_tree_get_type':
/tmp/go-build/cgo-gcc-prolog:10955:(.text+0x6b30): undefined reference to `g_tree_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_unicode_break_type_get_type':
/tmp/go-build/cgo-gcc-prolog:11832:(.text+0x7380): undefined reference to `g_unicode_break_type_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_unicode_script_get_type':
/tmp/go-build/cgo-gcc-prolog:11902:(.text+0x7420): undefined reference to `g_unicode_script_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_unicode_type_get_type':
/tmp/go-build/cgo-gcc-prolog:11939:(.text+0x7480): undefined reference to `g_unicode_type_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_uri_get_type':
/tmp/go-build/cgo-gcc-prolog:12247:(.text+0x77c0): undefined reference to `g_uri_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_value_dup_variant':
/tmp/go-build/cgo-gcc-prolog:13368:(.text+0x83c3): undefined reference to `g_value_dup_variant'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_variant_builder_get_type':
/tmp/go-build/cgo-gcc-prolog:13441:(.text+0x8450): undefined reference to `g_variant_builder_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_variant_dict_get_type':
/tmp/go-build/cgo-gcc-prolog:13630:(.text+0x8610): undefined reference to `g_variant_dict_get_type'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_variant_get_gtype':
/tmp/go-build/cgo-gcc-prolog:13994:(.text+0x89b0): undefined reference to `g_variant_get_gtype'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_variant_type_get_gtype':
/tmp/go-build/cgo-gcc-prolog:15215:(.text+0x9610): undefined reference to `g_variant_type_get_gtype'
/usr/bin/ld: $WORK/b240/_x002.o: in function `_cgo_0e499e6aadca_Cfunc_g_value_set_variant':
/tmp/go-build/cgo-gcc-prolog:13384:(.text+0x83e8): undefined reference to `g_value_set_variant'
collect2: error: ld returned 1 exit status
cat /home/void/.cache/go-build/fc/fc2bb4b31f242506accbdf385bb20e01618628d5f39701f029cd840ee3ebd546-d  # internal
# github.com/diamondburned/gotk4/pkg/core/gioutil
/usr/bin/ld: $WORK/b245/_x007.o: in function `gotk4_gbox_object_finalize':
/home/void/.local/share/go/pkg/mod/github.com/diamondburned/gotk4/[email protected]/core/gioutil/listmodel.c:24:(.text+0x191): undefined reference to `callbackDelete'
collect2: error: ld returned 1 exit status
mkdir -p $WORK/b242/
cd /home/void/.local/share/go/pkg/mod/github.com/diamondburned/gotk4/[email protected]/gtk/v4
pkg-config --cflags -- gtk4
pkg-config --libs -- gtk4
TERM='dumb' CGO_LDFLAGS='"-O2" "-g" "-lgtk-4" "-lharfbuzz" "-lpangocairo-1.0" "-lpango-1.0" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lvulkan" "-lgraphene-1.0" "-lgio-2.0" "-lglib-2.0" "-lgobject-2.0"' /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b242/ -importpath github.com/diamondburned/gotk4/pkg/gtk/v4 -- -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -mfpmath=sse -msse -msse2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/libpng16 -I/usr/include/pixman-1 -I $WORK/b242/ -O2 -g -Wno-deprecated-declarations ./gtk.go ./gtk_export.go

Walker won't run apps if runAsService = true;

I'm on nixOS, I installed walker using the homemanager module;
I have three different scenarios:

  • Launch walker normally, everything works as expected;
  • Launch walker as service walker --gapplication-service, same as above, works fine and speeds up following launches
  • Launch walker as service programs.walker.runAsService = true;, walker manages to open just fine, but when trying to launch something it returns terminal is not set and doesn't do anything, I am able to continue scrolling through the entries without the possibility to run it. Killing the service and running it again with walker --gapplication-service works fine.

Alternative keybinds

Would be cool if the up/down arrow keys and tab/shift+tab worked in addition to Ctrl+J/K

Improve documentation

Currently, the walker project has basically no documentation other than what the readme shows. The example config file doesn't contain everything, and doesn't explain what the individual options do. It is necessary to explore the code itself to even just see the which options are available, and even there the project doesn't have any comments or anything to potentially make it simpler to understand these options. Even though for some, it may be relatively clear, that's not necessarily the case for each of these values.

The project could also use some docs to describe what each of the CSS classes do, considering the styling is done with a custom CSS file.

I'd especially love to see documentation on the external modules, as it's fairly confusing to use in my opinion. I know that you have this example in your readme, which I did get to work:

    {
      "name": "filesystem",
      "prefix": "~",
      "src": "fd --base-directory /home/itsdrike/ %TERM%",
      "cmd": "xdg-open file://%RESULT%",
      "transform": true
    }

But there's no explanation on what's the point of that transform key here, how does src and cmd work? I assume src command gets ran on any user input, and cmd gets ran on the picked choice from that list? With this assumption then, I tried implementing a small custom external module, like this:

    {
      "name": "test",
      "prefix": "!",
      "src": "echo '%TERM%'",
      "cmd": "notify-send 'test' '%RESULT%'",
      "transform": true
    }

However, no items appeared in the menu, I don't understand why, there weren't any messages about this in the logs either. I then tried this:

    {
      "name": "test",
      "prefix": "!",
      "src": "ls %TERM%",
      "cmd": "notify-send 'test' '%RESULT%'",
      "transform": true
    }

For which, when there wasn't any input, it did show the ls items of the directory I ran walker from, however, the moment I started typing anything, the log started showing: exit status 2. But why is that? Exit status 2 from ls, according to the man page, means: serious trouble (e.g., cannot access command-line argument). Not exactly helpful in knowing what exactly going on though.

I tried some other things, but ultimately, I just wasn't able to figure out how it's supposed to work. The project really needs to do a better job at describing what it can actually do, and how it should be configured.

Even just a few github wiki pages would be a massive improvement here

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.