2.3 KiB
dmenu/rofi Utilities — README
Table Of Contents toc
Intro:
This repo contains 3 scripts (with 2 variants each.)
- repos
- sessions
- bookmarks
All of these scripts can be run with dmenu, or rofi. There are 6 total scripts, 2 for each script.
Find Repos
This script takes a list of your repos (from =/path/to/repos/), and opens it as a list in dmenu/rofi. From here, you can use fuzzy finding on that, or navigate it with vim binds if you have the correct dmenu/rofi flags set. When you hit enter on one of the repos, it will open a tmux session at that repo. If a tmux session does not exist yet at that repo, it will create one.
Scripts:
dmenu-repos.sh
Relavent modifications will go here:
# Set your terminal:
terminal="st"
# Set your dmenu flags
dmenu_flags="-i -vi -c -bw 3 -W 600 -l 30 -h 40 -F -fn 'JetBrainsMono Nerd Font:size=16' -p 'Projects:'"
# Pick repo
configs="$(ls -1d "$HOME"/repos/*/ 2>/dev/null | xargs -n1 basename)"
How to use:
- Change `terminal` to whatever terminal program you are running. (ie: `alacritty`, `xterm`, `urxvt`)
- Change `dmenu_flags` to whatever dmenu flags you want to pass in. The sane defaults I would say are `-l 30` to list it vertically for 30. The rest will be documented as dmenu patches in a future build.
- Make sure your repos are in `$HOME/repos` or just change that line in configs to `/path/to/repos`
- Run the script!
Where to bind this:
You can take this script and either keep it in this repo, or you can move it to `/usr/local/bin` and run `chmod +x` on it. Then in whatever window manager you are using, just add it to the binds as a script.
Examples:
DWM
// With Keychord Patch:
&((Keychord){2, {{MODKEY, XK_f}, {0, XK_f}}, spawn, SHCMD("$HOME/repos/dmenu-scripts/repos-dmenu.sh")}),
// Without Keychord Patch:
{ MODKEY, XK_p, spawn, SHCMD("repos-dmenu.sh") },
QTILE
# Without Keychord
Key([mod], "p", lazy.spawn("repos-dmenu.sh")),
# With Keychords
KeyChord([mod], "f", [
Key([], "f", lazy.spawn("repos-dmenu.sh")),
], mode="dmenu_scripts"), # 'mode' name shows in the Chord widget (optional)