All Projects → MaryHal → dmenu-suite

MaryHal / dmenu-suite

Licence: other
Various shell scripts that interface with dmenu (or fzf).

Programming Languages

python
139335 projects - #7 most used programming language
perl
6916 projects
shell
77523 projects

Labels

Projects that are alternatives of or similar to dmenu-suite

Ytfzf
A posix script to find and watch youtube videos from the terminal. (Without API)
Stars: ✭ 2,212 (+4153.85%)
Mutual labels:  fzf, dmenu
dotfiles
rice repo
Stars: ✭ 71 (+36.54%)
Mutual labels:  fzf, dmenu
patches
Collection of patches for dwm, st and dmenu
Stars: ✭ 202 (+288.46%)
Mutual labels:  dmenu
termv
A terminal iptv player written in bash
Stars: ✭ 119 (+128.85%)
Mutual labels:  fzf
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (+11.54%)
Mutual labels:  dmenu
vim-flow-outline
Outline for JS modules with Flow
Stars: ✭ 16 (-69.23%)
Mutual labels:  fzf
viconf
My (n)Vim config files
Stars: ✭ 18 (-65.38%)
Mutual labels:  fzf
vim-agriculture
🚜 Vim plugin to improve project searching with tools like ag and rg
Stars: ✭ 119 (+128.85%)
Mutual labels:  fzf
zsh-config
Faster and enjoyable ZSH (maybe) !!!
Stars: ✭ 64 (+23.08%)
Mutual labels:  fzf
fzf-checkout.vim
Manage branches and tags with fzf
Stars: ✭ 187 (+259.62%)
Mutual labels:  fzf
fzf-lsp.nvim
Enable the power of fzf fuzzy search for the neovim built in lsp
Stars: ✭ 143 (+175%)
Mutual labels:  fzf
fzf-floaterm
Fzf support for vim-floaterm
Stars: ✭ 20 (-61.54%)
Mutual labels:  fzf
fzf-obc
fzf over bash complete
Stars: ✭ 34 (-34.62%)
Mutual labels:  fzf
fm-nvim
🗂 Neovim plugin that lets you use your favorite terminal file managers (and fuzzy finders) from within Neovim.
Stars: ✭ 114 (+119.23%)
Mutual labels:  fzf
sysz
An fzf terminal UI for systemctl
Stars: ✭ 1,258 (+2319.23%)
Mutual labels:  fzf
rofi
Rofi: A window switcher, application launcher and dmenu replacement
Stars: ✭ 9,231 (+17651.92%)
Mutual labels:  dmenu
fzf-hoogle.vim
(neo)vim plugin that uses fzf for previewing hoogle search results
Stars: ✭ 37 (-28.85%)
Mutual labels:  fzf
fzf-preview.vim
fzf ❤️ preview
Stars: ✭ 49 (-5.77%)
Mutual labels:  fzf
helm-fzf
Fzf using Helm as a front end
Stars: ✭ 16 (-69.23%)
Mutual labels:  fzf
fuzzy-sys
Utility tool for using systemctl interactively
Stars: ✭ 106 (+103.85%)
Mutual labels:  fzf

Menu Suite

This is a collection of shell scripts that interface with either dmenu or fzf. There's also an experimental perl rewrite in the perl directory.

Since everyone's *nix setups are different, these scripts fit my personal use case and may not fit yours.

Included Scripts

Script Description
brightnessmenu Set laptop monitor brightness.
cpumenu Query and set system's enabled cpu profiles.
dvdmenu Navigate dvd with mpv.
i3windowSelect.py Jump-to-window/workspace in i3 (dmenu only)
infomenu Display some system information with acpi.
killmenu Kill processes.
menumenu Menu to select menus.
monitormenu Setup (preconfigured, hardcoded) monitor layouts with xrandr.
mpcmenu Interface for mpd using mpc.
netmenu Wifi profile select using netctl.
runmenu List and run programs in user's $PATH.
shutdownmenu Shutdown, reboot, and sleep.
wallpapermenu Set a wallpaper (using setroot) from a hardcoded directory. Need to implement selecting specific wallpapers for specific monitors.
wmmenu Unfinished script to interact with wmctrl.

Additional Perl Scripts

Script Description
MenuSuite.pm Perl module to manage menu making by using dispatch tables or simple list selection.
brightness.pl Set laptop monitor brightness.
cpugov.pl Query and set system's enabled cpu profiles.
kill.pl Kill processes.
menu.pl Menu to select menus (in this directory).
mpc.pl Interface for mpd using Net::MPD.
net.pl Wifi profile select using netctl.
pwsafe.pl Interact with pwsafe (mostly by spawning a terminal with that process running).
run.pl List and run programs in user's $PATH. Should have the same functionality as dmenu_run.
shutdown.pl Shutdown, reboot, and sleep.

Screenshot(s)

Dmenu2 screenshot FZF screenshot Rofi screenshot

Possible Usage

All scripts take a single optional argument to decide which backend to use. If this argument is excluded, dmenu is used by default. Backends supported: fzf, dmenu, and rofi.

Run mpcmenu (interface for mpd client) with dmenu:

~/bin/menu/scripts/mpcmenu dmenu

Run mpcmenu in a new terminal emulator (urxvt or termite) window with fzf:

urxvt -name "fzf-menu" -geometry 80x24 -e $HOME/bin/menu/scripts/mpcmenu fzf
termite --class "fzf-menu" --geometry 640x480 -e "$HOME/bin/menu/scripts/mpcmenu fzf"

We set an interface name for our urxvt window so we can allow a window manager to specifically manage these menus. For example, bspwm allows us to set rules for window interfaces:

bspc rule -a fzf-menu floating=on,center=on,monitor=LVDS1,follow=on

With this, my fzf-enabled menus will be floating and centered on my laptop monitor. It will also focus itself if I run it from any other monitor.

A similar rule for i3 would be:

for_window [class="^fzf-menu$"] floating enable, move output LVDS1

Note:

When spawning a new terminal to run the runmenu script (with fzf), sometimes the new process will not properly detach itself from its parent shell. So when the spawned terminal exits, the process started by runmenu will also exit.

Xresources

If you choose to use dmenu, lib/menu_helpers has a USE_DMENURC flag if you choose to not use the Xresources database (or don't have a version of dmenu that supports it). You should set that flag to 1 and modify lib/dmenurc in that case.

If you choose to go the Xresources route, you can specify options in your .Xresources file. For example, dmenu2 reads these:

dmenu.font:          DroidSansFallback:bold:size=8
dmenu.foreground:    #C7CCD1
dmenu.background:    #1C2023
dmenu.selbackground: #95AEC7
dmenu.selforeground: #1C2023

Remember to run xrdb -merge ~/.Xresources to load these new values!

Lockfiles

A useful concept relevant to these scripts are semaphores (in particular, lockfiles). What lockfiles will allow use to do is to ensure that there is only one running menu at a time. There are many tools to do this: lockfile, flock, and some homegrown (albeit flawed) solutions. lockwrap is an extremely simple script that will pass your command to flock under a predefined lock name:

Inside lockwrap:

#!/bin/sh
flock -n /tmp/menusuite.lock -c $@

Usage:

$ ./lockwrap ./mpcmenu
$ ./lockwrap alsamixer

If these commands are immediately run one after another, alsamixer will not be opened as mpcmenu would be using the lockfile.

TODO

Shell Scripts

  • Sourcing menu_helpers.sh introduces redundancy into every menu script. Maybe a way to solve this is to have another wrapper script to run each menu.

  • Merge menu_helpers.sh into menuwrap.sh. The problem I have with this though is that each menu script can no longer be run without delegation from menuwrap.sh.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].