Skip to content

Bind glimpse to keys ​

glimpse's tools are ordinary commands, so any key your compositor can bind can drive them.

CommandWhat it does
loginctl lock-sessionLock the screen now
glimpse-shot --screenFreeze the screen and mark it up
glimpse-shot --windowClick a window, then mark it up
glimpse-shot --regionDrag a rectangle (Space takes the whole screen), then mark it up
glimpse-shot capture --copy --no-saveCopy the focused output, no file, no window
glimpse-lens --tool picker | wl-copy -nPick a color and copy its hex value
glimpsectl applet toggle clockOpen or close the clock's calendar popover
glimpsectl notifications dnd onSilence notifications until you turn it off
glimpsectl notifications dnd on --until 18:00Silence them until a local time, today or tomorrow
glimpsectl notifications dnd offLet notifications through again
glimpsectl appearance set darkHold the desktop in dark mode
glimpsectl appearance resumeFollow the configured light/dark policy again
glimpsectl night-light pauseKeep daylight color until the current night ends

applet toggle takes the applet name; with a bar on several monitors, add --output and the connector. With two bars on one monitor, add --edge too (top, bottom, left or right). glimpsectl refuses an ambiguous name. glimpsectl applet list lists the names, outputs and edges. Every command and flag is in the command reference: glimpsectl, glimpse-shot, glimpse-lens.

A binding in your compositor's configuration pairs a key with one of the commands above (the syntax is your compositor's):

kdl
// ~/.config/niri/config.kdl
binds {
    Mod+Shift+X { spawn "loginctl" "lock-session"; }
    Print { spawn "glimpse-shot" "--screen"; }
    Mod+Shift+C { spawn "sh" "-c" "glimpse-lens --tool picker | wl-copy -n"; }
    Mod+Shift+D { spawn "glimpsectl" "applet" "toggle" "clock"; }
}

Released under the BSD 3-Clause license.