All Projects → Biont → Sway Launcher Desktop

Biont / Sway Launcher Desktop

Licence: gpl-3.0
TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Sway Launcher Desktop

raiseorlaunch
A run-or-raise-application-launcher for i3 window manager.
Stars: ✭ 35 (-81.38%)
Mutual labels:  launcher, i3wm
paruz
A fzf terminal UI for paru or pacman
Stars: ✭ 29 (-84.57%)
Mutual labels:  fzf, tui
xplr
A hackable, minimal, fast TUI file explorer
Stars: ✭ 2,271 (+1107.98%)
Mutual labels:  launcher, tui
sysz
An fzf terminal UI for systemctl
Stars: ✭ 1,258 (+569.15%)
Mutual labels:  fzf, tui
Sgtk Menu
GTK launchers for sway & other WMs w/ menu, dmenu, application grid and button bar
Stars: ✭ 112 (-40.43%)
Mutual labels:  i3wm, menu
Tmux Fzf Url
🚀 Quickly open urls on your terminal screen!
Stars: ✭ 227 (+20.74%)
Mutual labels:  fzf, tui
Asuite
ASuite is a simple open source portable launcher for Microsoft Windows.
Stars: ✭ 58 (-69.15%)
Mutual labels:  launcher, menu
Nwg Launchers
GTK-based launchers: application grid, button bar, dmenu for sway and other window managers
Stars: ✭ 211 (+12.23%)
Mutual labels:  launcher, i3wm
Fmui
fzf mpd user interface
Stars: ✭ 93 (-50.53%)
Mutual labels:  fzf, tui
Jgmenu
A simple X11 menu
Stars: ✭ 523 (+178.19%)
Mutual labels:  launcher, menu
Sad
CLI search and replace | Space Age seD
Stars: ✭ 350 (+86.17%)
Mutual labels:  fzf, tui
3mux
Terminal multiplexer inspired by i3
Stars: ✭ 1,687 (+797.34%)
Mutual labels:  tui, i3wm
Nnn
n³ The unorthodox terminal file manager
Stars: ✭ 13,138 (+6888.3%)
Mutual labels:  launcher, tui
Brisk Menu
An efficient menu for the MATE Desktop
Stars: ✭ 142 (-24.47%)
Mutual labels:  launcher, menu
Multimc5
A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once
Stars: ✭ 2,879 (+1431.38%)
Mutual labels:  launcher
Dotfiles
My [NeoVim + Tmux + Fish Shell] Setup /w install scripts
Stars: ✭ 180 (-4.26%)
Mutual labels:  i3wm
Hascard
flashcard TUI with markdown cards
Stars: ✭ 171 (-9.04%)
Mutual labels:  tui
Jquery Ui Contextmenu
jQuery plugin that turns a jQueryUI menu widget into a context menu.
Stars: ✭ 170 (-9.57%)
Mutual labels:  menu
Material Ui Popup State
boilerplate for common Material-UI Menu, Popover and Popper use cases
Stars: ✭ 186 (-1.06%)
Mutual labels:  menu
Smos
A comprehensive self-management System
Stars: ✭ 179 (-4.79%)
Mutual labels:  tui

sway-launcher-desktop Build Status

screenshot_2019-10-25-213740

This is a TUI-based launcher menu made with bash and the amazing fzf. Despite its name, it does not (read: no longer) depend on the Sway window manager in any way and can be used with just about any WM.

Features

  • Lists and executes available binaries
  • Lists and executes .desktop files (entries as well as actions)
  • Does not depend on xdg-utils. Just pure bash and awk
  • Shows a preview window containing whatis info of binaries and the Comment= section of .desktop files
  • History support which will highlight recently used entries
  • Colored output and glyphs for the different entry types
  • Entries are lazily piped into fzf eliminating any lag during startup
  • Optional support for the XDG Autostart specification
  • Executes arbitrary custom commands (if there are no other matches)

Installation

Make sure you have fzf installed and download this repository. Arch Linux users can also grab it from the AUR (thanks @turtlewit)

Configure it in Sway like this:

for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10
set $menu exec $term --class=launcher -e /path/to/repo/sway-launcher-desktop.sh
bindsym $mod+d exec $menu

You can override the default icons/glyphs by setting the appropriate GLYPH_ variable in your $menu command, e.g.:

set $menu exec $term --class=launcher -e env GLYPH_COMMAND="" GLYPH_DESKTOP="" GLYPH_PROMPT="? " sway-launcher

By default, the launcher will use a generic & WM-agnostic command to launch the selected program. However, it will detect if its output is being piped to another program and merely print the selected command in that case - instead of launching it by itself. You can use this to integrate the launcher with other tools. For example, if you wish to launch your programs with swaymsg exec, you can do that like this¹:

 swaymsg exec "$(./sway-launcher-desktop.sh)"

Setup a Terminal command

Some of your desktop entries will probably be TUI programs that expect to be launched in a new terminal window. Those entries have the Terminal=true flag set and you need to tell the launcher which terminal emulator to use. Pass the TERMINAL_COMMAND environment variable with your terminal startup command to the script to use your preferred terminal emulator. The script will default to $TERM -e

Configure application autostart

If you want to be able to autostart applications , this script provides a function to handle them for you. Simply run sway-launcher-desktop.sh autostart in your .bashrc, at the end of your i3/sway config, or wherever else you deem fit.

Extending the launcher

In addition to desktop application entries and binaries, you can extend sway-launcher-desktop with custom item providers. It will read the configuration of custom item providers from $HOME/.config/sway-launcher-desktop/providers.conf. The structure looks like this:

[my-provider]
list_cmd=echo -e 'my-custom-entry\034my-provider\034  My custom provider'
preview_cmd=echo -e 'This is the preview of {1}'
launch_cmd=notify-send 'I am now launching {1}'

The list_cmd generated the list of entries. For each entry, it has to print the following columns, separated by the \034 field separator character:

  1. The item to launch. This will get passed to preview_cmd and launch_cmd as {1}
  2. The name of your provider (the same as what what you put inside the brackets, so my-provider in this example)
  3. The text that appears in the fzf window. You might want to prepend it with a glyph and add some color via ANSI escape codes
  4. (optional) Metadata that you can pass to preview_cmd and launch_cmd as {2}. For example, this is used to specify a specific Desktop Action inside a .desktop file

The preview_cmd renders the contents of the fzf preview panel. You can use the template variable {1} in your command, which will be substituted with the value of the selected item.

The launch_cmd is fired when the user has selected one of the provider's entries.

Note: Pass the environment variable PROVIDERS_FILE to read custom providers from another file than the default providers.conf. The path in PROVIDERS_FILE can either be absolute or relative to ${HOME}/.config/sway-launcher-desktop/.

Launcher history file

By default, sway-launcher-desktop stores a history of commands to make frequently used entries available more quickly. This history is stored in a file in ~/.cache/ (or $XDG_CACHE_HOME, if that environment variable is set). You may change the file path and name by setting the environment variable HIST_FILE to the desired path. Setting the variable to an empty value disables the history feature entirely.

Troubleshooting

Debug information is directed to file descriptor 3 and can be dumped using ./sway-launcher-desktop.sh 3>> ~/sway-launcher-desktop.log


¹ If you want to use this as a keybinding though, this kind of shell substitution will not work inside the config file. Here's a way to make it work

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].