Coder Social home page Coder Social logo

chmouel / raffi Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 0.0 8.25 MB

fuzzel launcher based on yaml configuration

License: Apache License 2.0

Makefile 2.66% Go 0.63% Rust 73.43% Ruby 5.55% Shell 17.73%
fuzzel launcher sway wayland yaml yaml-config

raffi's Introduction

raffi - fuzzel launcher on yaml config file

image

(this uses my fuzzel config, see below)

Description

raffi is a launcher for fuzzel, it uses a yaml config file to define the commands to be executed.

Installation

Go to the release page and grab the archive or package targeting your platform.

Make sure you install fuzzel

brew tap chmouel/raffi https://github.com/chmouel/raffi
brew install raffi
cargo install raffi

With your favourite aurhelper for example yay :

yay -S raffi-bin

Usage

You can launch it directly and it will run the binary and args as defined in the configuration.

With the option -p/--print-only it will only print the command to be executed.

You can specify a custom config file with the -c/--configfile option.

Icon path are automatically searched on your system and cached, if you need to refresh the cache you can use the option -r/--refresh-cache.

Sway

Here is an example on how to use this with Sway:

// set a variable that can be easily used later in the config file
// those variables are optionals
set $menu raffi -p

// Mod4 is the Super key for me but use whatever you want.
set $super Mod4

// will bind the super+space key to launch the launcher
bindsym $super+Space exec $menu|xargs swaymsg exec --

Configuration

Fuzzel

First you may want to configure your fuzzel appearance and behaviour, by configuring your file ~/.config/fuzzel/fuzzel.ini see the manpages here. My configuration:

dpi-aware=yes
font=RobotoMonoNerdFont-Thin:size=16
terminal=kitty
width=50
layer=overlay
exit-on-keyboard-focus-loss=no
inner-pad=15
fields=filename,name

[colors]
background=282a36ff
text=f8f8f2ff
match=8be9fdff
selection-match=8be9fdff
selection=44475add
selection-text=f8f8f2ff
border=bd93f9ff

Raffi

Raffi configuration file is located at $HOME/.config/raffi/raffi.yaml and it has the following structure:

firefox:
  binary: firefox
  args: [--marionette]
  icon: firefox
  description: Firefox browser with marionette enabled
  • binary: The binary to be executed (if not exist in PATH it will be skipped)
  • description: The description to be displayed in the launcher
  • args: The arguments to be passed to the binary as array i.e: [foo, bar] (optional)
  • icon: The icon to be displayed in the launcher if not specified it will try to use binary name (optional) icons are searched in /usr/share/icons, /usr/share/pixmaps, $HOME/.local/share/icons or in $XDG_DATA_HOME if set and matched to the icon name. You can as well specify the full path in there.

Conditions

there is some mininal support for conditions, to let you run a command only if a condition is met. They are all optional and cannot be used in combination.

ifexist: show entry if a file exist in PATH or the full path can be specified ifenvset: show entry if the environment variable is set ifenvnotset: show entry if the environment variable is not set ifenveq: show entry if the environment variable is equal to the value, for example:

ifenvset: [FOO, bar]

will only show the entry if an environment variable FOO is set and its value is bar.

Example

See the file located in examples/raffi.yaml for a comprehensive example.

Copyright

Apache-2.0

Authors

raffi's People

Contributors

chmouel avatar dependabot[bot] avatar goreleaserbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

raffi's Issues

thread 'main' panicked at src/main.rs:81:49

When I try to run the binary I get:

./raffi

thread 'main' panicked at src/main.rs:81:49:
cannot open config file /home/balkd/.config/raffi/raffi.yaml
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

RUST_BACKTRACE=1 ./raffi

thread 'main' panicked at src/main.rs:81:49:
cannot open config file /home/balkd/.config/raffi/raffi.yaml
stack backtrace:
0: rust_begin_unwind
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
1: core::panicking::panic_fmt
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
2: raffi::read_config::{{closure}}
3: raffi::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

RUST_BACKTRACE=full ./raffi

thread 'main' panicked at src/main.rs:81:49:
cannot open config file /home/balkd/.config/raffi/raffi.yaml
stack backtrace:
0: 0x5556b359d60c - std::backtrace_rs::backtrace::libunwind::trace::h67a838aed1f4d6ec
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x5556b359d60c - std::backtrace_rs::backtrace::trace_unsynchronized::h1d1786bb1962baf8
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x5556b359d60c - std::sys_common::backtrace::_print_fmt::h5a0b1f807a002d23
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:67:5
3: 0x5556b359d60c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf84ab6ad0b91784c
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:44:22
4: 0x5556b35c6e0c - core::fmt::rt::Argument::fmt::h28f463bd1fdabed5
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/fmt/rt.rs:138:9
5: 0x5556b35c6e0c - core::fmt::write::ha37c23b175e921b3
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/fmt/mod.rs:1114:21
6: 0x5556b359a88e - std::io::Write::write_fmt::haa1b000741bcbbe1
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/io/mod.rs:1763:15
7: 0x5556b359d3f4 - std::sys_common::backtrace::_print::h1ff1030b04dfb157
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:47:5
8: 0x5556b359d3f4 - std::sys_common::backtrace::print::hb982056c6f29541c
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:34:9
9: 0x5556b359e973 - std::panicking::default_hook::{{closure}}::h11f92f82c62fbd68
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:272:22
10: 0x5556b359e694 - std::panicking::default_hook::hb8810fe276772c66
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:292:9
11: 0x5556b359eef5 - std::panicking::rust_panic_with_hook::hd2f0efd2fec86cb0
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:731:13
12: 0x5556b359edf1 - std::panicking::begin_panic_handler::{{closure}}::h3651b7fc4f61d784
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:609:13
13: 0x5556b359db36 - std::sys_common::backtrace::__rust_end_short_backtrace::hbc468e4b98c7ae04
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/sys_common/backtrace.rs:170:18
14: 0x5556b359eb42 - rust_begin_unwind
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
15: 0x5556b3540e45 - core::panicking::panic_fmt::h979245e2fdb2fabd
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
16: 0x5556b354380e - raffi::read_config::{{closure}}::h36cb462f390be405
17: 0x5556b354790b - raffi::main::hb1c34b835e78544e
18: 0x5556b35548d3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf15df90d9d97935c
19: 0x5556b3558439 - std::rt::lang_start::{{closure}}::h6942ec1f28e7be3d
20: 0x5556b359674b - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::hf9057cfaeeb252e2
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:284:13
21: 0x5556b359674b - std::panicking::try::do_call::h629e203a624883e4
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
22: 0x5556b359674b - std::panicking::try::h7b61614724d6a4f1
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
23: 0x5556b359674b - std::panic::catch_unwind::h354ac1c0268491d8
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
24: 0x5556b359674b - std::rt::lang_start_internal::{{closure}}::h919fee3c5ba8f617
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/rt.rs:148:48
25: 0x5556b359674b - std::panicking::try::do_call::h54583f67455bff32
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
26: 0x5556b359674b - std::panicking::try::hb0e12c4e01d39dc2
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
27: 0x5556b359674b - std::panic::catch_unwind::h367b6339e3ca9a3b
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
28: 0x5556b359674b - std::rt::lang_start_internal::ha5ce8533eaa0fda8
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/rt.rs:148:20
29: 0x5556b3548d45 - main
30: 0x7fa2c1a23b4c - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
31: 0x7fa2c1a23c05 - __libc_start_main_impl
at ./csu/../csu/libc-start.c:360:3
32: 0x5556b35415a5 - _start
33: 0x0 -

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.