wofi(7)

πŸ“¦
version 1.5.3 Β· 4 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸŽ€ WOFI πŸŽ€

okay bestie, welcome to wofi(7) from the Miscellaneous Information Manual β€” this is the page about all the built-in modes and the extra little features, and yes we are gonna get through literally all of it together πŸ’…


✨ NAME ✨

wofi β€” built in modes and other features. that's it, that's the name, slay.


🌸 DESCRIPTION 🌸

So wofi has a bunch of built in modes plus a whole lot of other features β€” including combi β€” and this page is where all of that gets documented. you're in the right place, babe 🫢

important thing first: every config option written up here is stripped of its mode name. Mode specific options get put in the config file in the format mode-example_opt=val.

Example so it's crystal clear: dmenu has an option called parse_action, so in the config file you'd write it like this:

dmenu-parse_action=true

see? mode name, dash, option. that's the whole vibe ✨


πŸ‘‘ MODES πŸ‘‘

right now wofi has 3 built in modes:

  1. run β€” searches $PATH for executables and lets you run them by selecting them.
  2. drun β€” searches $XDG_DATA_HOME/applications and $XDG_DATA_DIRS/applications for desktop files and lets you run them by selecting them.
  3. dmenu β€” reads from stdin, shows you the options, and whatever you select gets output to stdout.

if $XDG_DATA_HOME isn't specified it defaults to ~/.local/share. if $XDG_DATA_DIRS isn't specified it defaults to:

/usr/local/share:/usr/share

Now β€” combi. it's not a mode, bestie, it's a feature. you use it like this:

--show mode1,mode2,mode3,etc

you can mix and match any number of modes, BUT each mode can only be loaded once. so something like --show run,drun,run is not supported. (and honestly? not sure why you'd do that in the first place 😭)


πŸ’… DMENU CONFIG OPTIONS πŸ’…

  • parse_action=BOOL β€” if true, the result dmenu hands back gets stripped of image escape sequences and pango markup. default is false.
  • separator=CHAR β€” the character used to separate dmenu entries. default is \n.
  • print_line_num=BOOL β€” when an entry gets selected, instead of printing the entry itself it prints the number of the line that entry was on. heads up: this disables caching, because it's fundamentally incompatible with it.

πŸ”₯ RUN πŸ”₯

in run mode, holding ctrl while running an entry makes the arguments get parsed β€” even if always_parse_args=false. holding shift makes the entry run in a terminal. little keyboard shortcuts, big energy πŸ’–

🌈 RUN CONFIG OPTIONS 🌈

  • always_parse_args=BOOL β€” if true, spaces won't be treated as part of the executable name, they get treated as an argument separator β€” same thing as holding control while pressing enter. default is false.
  • show_all=BOOL β€” if true, shows all the entries in path, including entries that have the same executable name. for example /bin/bash and /usr/bin/bash get shown separately as bash, instead of there just being one bash entry for the first one encountered. default is true.
  • print_command=BOOL β€” if true, the executable that would be run gets printed to stdout instead of actually being executed. default is false.

πŸ¦‹ DRUN CONFIG OPTIONS πŸ¦‹

  • print_command=BOOL β€” if true, the command used to launch the desktop file gets printed to stdout instead of being invoked. default is false.
  • display_generic=BOOL β€” if true, generic names get displayed in () right next to the application name. default is false.
  • disable_prime=BOOL β€” if true, wofi will ignore the PrefersNonDefaultGPU desktop variable β€” specifically, this stops wofi from setting DRI_PRIME. default is false.
  • print_desktop_file=BOOL β€” if true, the path to the desktop file and the name of the corresponding action (if there is one) get printed to stdout instead of being invoked. default is false.
  • ignore_metadata=BOOL β€” if true, only the application's name gets searched, instead of the normal behavior of searching a large amount of metadata β€” including category and description. default is false.

πŸ“ DRUN πŸ“

when images are enabled, drun mode will pull icon themes. but because it's a GTK app, there's a real chance you'll need to run gtk-update-icon-cache to get them to actually apply. just a lil heads up 🧚


πŸ’œ LOCATIONS πŸ’œ

there are 9 possible locations, and you can specify them either by name or by number. the numbering scheme is the same as in rofi, and the matching number is listed next to each name below. the default is center.

  1. center β€” 0
  2. top_left β€” 1
  3. top β€” 2
  4. top_right β€” 3
  5. right β€” 4
  6. bottom_right β€” 5
  7. bottom β€” 6
  8. bottom_left β€” 7
  9. left β€” 8

okay now the ✨math✨ of offsets, stay with me. the x and y offsets are applied based on layer-shell anchors, which means an x offset can only be applied if wofi is anchored on the x axis. so basically: you can only use an x offset with the top_left, top_right, right, bottom_right, bottom_left, and left locations. center, top, and bottom can't have x offsets because they're not anchored on the x axis.

likewise, y offsets can only be applied to top_left, top, top_right, bottom_right, bottom, and bottom_left locations. center, left, and right can't have y offsets because they're not anchored to the y axis.

and since center can't have offsets on either β€” it's not anchored to any axis β€” any x or y offset applied while using center will override the location to top_left, for backwards compatibility reasons. (because otherwise the offsets would just get ignored anyway, so like, at least it does something πŸ’€)


⭐ ORDER ⭐

there are 2 order options right now: default and alphabetical.

  • default means entries are displayed in the order they get added by the mode. for all the built in modes this is cached items first, followed by other entries in no specific order.
  • alphabetical means entries are alphabetically sorted. period.
these orders only affect the order when no search has been entered. once a search is entered, the order gets re-arranged based on the current matching preference, and this order is ignored.

πŸŽ€ CACHING πŸŽ€

caching cannot be disabled. but bestie, you can set the cache file to /dev/null to effectively disable it. loophole queen πŸ’…


πŸͺŸ WINDOW SWITCHER πŸͺŸ

okay so wofi does not have the ability to do window switching on its own, because there's no way to do that with wayland/wlroots protocols. sad, but true 😭

however! if you're using sway, you can use swaymsg with dmenu mode to pull it off. here's the script:

swaymsg -t get_tree |
  jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else []
end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + "
" + .name)' |
  wofi --show dmenu | {
    read -r id name
    swaymsg "[con_id=$id]" focus
}

go off, you just got window switching on wayland 🫢


🌈 WIDGET LAYOUT 🌈

this section is for advanced CSS β€” the kind that needs more control than the built in wofi CSS names/classes allow for.

⚠️ this widget layout is subject to change at any time and without warning, so your CSS might very well break if you rely on this. be careful out there, babe.

widgets have their corresponding names next to them if they have one. here's the whole tree:

window - #window
    box - #outer-box
        entry - #input

        scrolledwindow - #scroll
            viewport
                box
                    flowbox - #inner-box
                        flowboxchild - #entry

                            .entry - #unselected or #selected
                                image
                                label

                            expander
                                .entry - #unselected or #selected
                                    image
                                    label

                                list
                                    row - #entry
                                        .entry - #unselected or #selected
                                            image
                                            label
            scrollbar

now let me walk you through what all of that actually means:

  • the first .entry (#unselected or #selected) only exists if there's ONLY 1 action. it's a WofiPropertyBox which has no CSS node and should probably not be used. its name depends on whether or not the entry is selected. see wofi(5) on #selected and #unselected for info.
    • image β€” only present if there's an image in the entry, and it might occur multiple times if multiple images are present.
    • label β€” only present if there's text in the entry, and it might occur multiple times if there are multiple text objects in a single entry.
  • expander β€” this and its children only exist if there are multiple actions on the entry.
    • .entry (#unselected or #selected) β€” this is the main action. it's a WofiPropertyBox which has no CSS node and should probably not be used. the name depends on whether or not the entry is selected. see wofi(5) on #selected and #unselected for info.
      • image β€” only present if there's an image in the entry, and it might occur multiple times if multiple images are present.
      • label β€” only present if there's text in the entry, and it might occur multiple times if there are multiple text objects in a single entry.
    • list β€” this contains all the secondary actions.
      • row - #entry
        • .entry (#unselected or #selected) β€” a WofiPropertyBox which has no CSS node and should probably not be used. the name depends on whether or not the entry is selected. see wofi(5) on #selected and #unselected for info.
          • image β€” only present if there's an image in the entry, and it might occur multiple times if multiple images are present.
          • label β€” only present if there's text in the entry, and it might occur multiple times if there are multiple text objects in a single entry.

and that's the whole page, bestie πŸ₯Ή that was wofi(7) from the Miscellaneous Information Manual β€” yes the footer really is just wofi(7), she's mysterious like that πŸ’…βœ¨ go forth and slay your configs πŸ’–