Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

41
Extended swaymsg zsh completions
Post Body

So sway has a ton of commands -- more than i3 since it's responsible for input and output devices as well. swaymsg is a nice client, but for me its easy to forget the names and arguments of the sway commands themselves.

That's why I've made some extended zsh completions for swaymsg to support them.

There are still some changes/features I'd like to implement, but they are working pretty well for me already, so I thought I'd share.

Some loose goals:

  • complete sway commands and their arguments
  • complete sway input/output device names and options
  • complete sway criteria predicates where appropriate
  • document options with descriptions from the man page and elsewhere, so you know what you're completing.

You'll need jq to complete most input/output device stuff, and you'll need xsltproc (libxslt) to complete the xkb stuff, but it should do its best without, and shouldn't error without them. Everything else should work fine without.

Here are some example screenshots of it completing stuff:

There are plenty more things to complete, but you get the idea.

If you're a zsh user, check them out. Just put the completions somewhere early in your fpath to override the basic completions shipped with sway. I like to use ${XDG_DATA_HOME:-$HOME/.local/share}/zsh/completions/ for this purpose. Not super well tested yet, so if you find a bug or have a suggestion, let me know. I'll probably continue to update them for a bit.

Author
Account Strength
100%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
13,092
Link Karma
584
Comment Karma
12,216
Profile updated: 5 days ago
Posts updated: 9 months ago
:sway: brocellous

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago