Skip to content

monooso/snyp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snyp

A Wayland-compatible global snippet manager. Store text snippets and templates, select them via a fuzzy-searchable menu, and copy them straight to the clipboard.

Snyp uses wofi for the selection UI and wl-copy for clipboard access. Bind it to a keyboard shortcut in your Wayland compositor for quick access.

Dependencies

  • wofi -- dmenu replacement for Wayland
  • wl-clipboard -- provides wl-copy
  • Go 1.25.5+ (build only)

On Fedora:

sudo dnf install wofi wl-clipboard

On Arch:

sudo pacman -S wofi wl-clipboard

Installation

go install github.com/monooso/snyp@latest

Or build from source:

git clone https://github.com/monooso/snyp.git
cd snyp
go build -o snyp .

Then move the binary somewhere on your $PATH.

Usage

Run snyp to open the snippet selector. It will:

  1. Load all snippets from your snippets directory
  2. Present a fuzzy-searchable menu via wofi
  3. Expand any template functions (for .tmpl files)
  4. Copy the result to your clipboard

Snippets directory

Snyp looks for snippets in $XDG_CONFIG_HOME/snyp/snippets/. If XDG_CONFIG_HOME is not set, it falls back to ~/.config/snyp/snippets/.

Subdirectories are supported -- a file at work/email-sig.txt appears in the menu as work/email-sig.

File types

  • .txt -- plain text, copied as-is
  • .tmpl -- expanded as a Go template before copying

Templates

Template files (.tmpl) are processed through Go's text/template with the following custom functions:

Function Description Example
date "format" Current date in Go time format {{date "2006-01-02"}}
time "format" Current time in Go time format {{time "15:04"}}
now Returns a time.Time value for use with methods {{now.Year}}
env "KEY" Value of an environment variable {{env "USER"}}
shell "cmd" Output of a shell command (trailing newline stripped) {{shell "hostname"}}

Example snippets

daily-standup.tmpl -- daily standup template:

Standup {{date "2006-01-02"}}

Yesterday:
-

Today:
-

Blockers:
-

email-sig.tmpl -- email signature:

Regards,
{{env "USER"}}

git-branch.tmpl -- current git branch name:

{{shell "git branch --show-current"}}

meeting-notes.tmpl -- meeting notes header:

# Meeting Notes -- {{date "02 Jan 2006"}} {{time "15:04"}}

Attendees:

## Agenda

## Actions

uuid.tmpl -- generate a UUID:

{{shell "cat /proc/sys/kernel/random/uuid"}}

shrug.txt -- plain text, no template expansion:

\_(ツ)_/

Keyboard shortcut

Bind snyp to a key in your compositor. For example, in Sway:

bindsym $mod+s exec snyp

In Hyprland:

bind = $mainMod, S, exec, snyp

Licence

AGPL-3.0

About

A Wayland-compatible global snippet manager.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages