Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple rofi launcher

License

NotificationsYou must be signed in to change notification settings

chmouel/mounch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Mounch is a simple launcher usingROFI on Xorg orWOFI on Wayland backed by a yaml configuration file.

You simply define a set of configuration blocks for some custom commands and it will show them with the awesome rofi. The items are sorted by frequency or as the order coming from themounch.yaml config file.

Why not just usedmenu rofi module you may ask ?

  • I simply did not want to have to create a.desktop file for every apps I have, and find it much simpler to have everything in a simple yaml definition.
  • I did not want to have the launcher offering everythign I have on my system
  • I wanted a curated list
  • I wanted some title that differs from what's shipped on the .desktop from the system.
  • I switch often between desktop/wm (ie: gnome/sway) and display system (xorg/wayland) and I want entries depending of the current environement
  • And I wanted to have static ordering as well as frequency based one, which is fitting my workflow.

Requirements

Screenshot

image

Installation

Arch AUR

Manual

  1. Checkout this repository with git :

     mkdir ~/git/ git clone https://github.com/chmouel/mounch  ~/git/mounch
  2. Copy the theme to your rofi config directory :

     mkdir -p ~/.config/rofi && cp ~/git/mounch/rofi/mounch.rasi ~/.config/rofi/
  3. Setup yourmounch.yaml in~/.config/mounch/mounch.yaml look at the examplehere.

  4. Depending on how you setup your desktop setup a key to launch themain scriptin~/git/mounch/mounch.py if you have followed thru.

  5. Installpyyaml python library (which youprobably have already), packages are called

Configuration

The basic definition look like this :

firefox:binary:gtk-launchargs:firefoxdescription:"Firefox"icon:firefox

You are starting by a unique id as a key from this yaml snippet called firefox,you launch a binary calledgtk-launch which is astandard gtk tool who launch your desktop application, you give the argsfirefox and you use the icon firefox which is picked up from your local iconfiles.

  • args can be a list, ie:args:["firefox", "https://linux.com/"]

  • binaries are looked into your path.

  • the icons is the standard freedesktop ones, add new ones in for example:

    ~/.local/share/icons/hicolor/scalable/apps/

  • and if you like you can add some condition too with theif keyword, it must return a pythonboolean, ie:

firefox:binary:gtk-launchargs:spotifydescription:"Spotify"icon:spotifyif:'shutil.which("spotify")'

see a most complete examplehere.

By defaultmounch add some sane arguments torofi orwofi if you don'twant them and want to let the launcher config files set the options then use the-N/--no-defaults option.

Wayland

When detecting wayland it will try to usewofi instead of rofi, you can specify --use-rofi to force use rofi.

There is currently a bug with the stable version of wofi where the"--allow-images" flag doesn't get parsed.

The bug is fixed in the development branch of wofi and until then you will needto add this directive directly to your~/.config/wofi/config :

allow_images=true

There is multiples options you can configure to tweak wofi with its config, seewofi(5), here is mine :

allow_images=truecolors=colorsfilter_rate=100allow_markup=truelines=15

It works well with thedracula wofi theme (as seen on the screenshot)

If you runsway you may want to do this for your configuration so sway execute the command directly :

set $menu mounch -pbindsym $mod+d exec $menu|xargs swaymsg exec --

If you run with Gnome on Wayland, you may want to make it to center new window automatically or mutter (the gnome wm) will show the windows randomly around the screen, which is quite annoying with a launcher like wofi, you just need to run this command to make it automatically centers them :

dconf write /org/gnome/mutter/center-new-windowstrue

Internals

We cache all entries in a simple file in $HOME/.cache/mounch/cache, it's simple and has only the id name and the number of times the entry has been launched.Before launch we sort that list and display the top hit at the top and the rest as configured in the mounch.yaml config file.After launch we increase the counter and rewrite the cache file.

Alternatives

I rewrote it in rust, with a bit different syntax and focused to wofi/wayland called raffi and available herehttps://github.com/chmouel/raffi. This python version goes as fast as the rust version, there is no reason to switch if you don't care.

Misc


[8]ページ先頭

©2009-2025 Movatter.jp