- Notifications
You must be signed in to change notification settings - Fork3
chmouel/mounch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
Package available from here:
https://aur.archlinux.org/packages/mounch/
example config file in /usr/share/doc/mounch and helpers in /usr/share/mounch/
rofi theme is preinstalled in /usr/share/rofi/themes/
Checkout this repository with git :
mkdir ~/git/ git clone https://github.com/chmouel/mounch ~/git/mounch
Copy the theme to your rofi config directory :
mkdir -p ~/.config/rofi && cp ~/git/mounch/rofi/mounch.rasi ~/.config/rofi/
Setup your
mounch.yaml
in~/.config/mounch/mounch.yaml
look at the examplehere.Depending on how you setup your desktop setup a key to launch themain scriptin
~/git/mounch/mounch.py
if you have followed thru.Installpyyaml python library (which youprobably have already), packages are called
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 the
if
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.
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
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.
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.
- License:Apache License
- Authors: Chmouel Boudjnahchmouel@chmouel.com
About
A simple rofi launcher