Wayland screenshot annotation tool in Zig.
The main repository is on codeberg, which is where the issue tracker may be found and where contributions are accepted.
Read-only mirrors exist on github.
- wayland (compositor)
- wlroots (compositor)
- cairo (drawing)
- D-Bus (communication with portal and sneemok daemon)
- XDG Desktop Portal (for screenshot capture)
wget https://codeberg.org/fn3x/sneemok/raw/branch/main/scripts/install.sh
chmod +x install.sh
./install.shyay -S sneemok
# or
yay -S sneemok-gitIn your Home Manager configuration:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
sneemok.url = "git+https://codeberg.org/fn3x/sneemok.git";
};
outputs = { nixpkgs, home-manager, sneemok, ... }: {
homeConfigurations.youruser = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
sneemok.homeManagerModules.default
{
services.sneemok = {
enable = true;
};
}
];
};
};
}Then rebuild:
home-manager switch --flake .#youruserIn your NixOS configuration:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sneemok.url = "git+https://codeberg.org/fn3x/sneemok.git";
};
outputs = { nixpkgs, sneemok, ... }: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
sneemok.nixosModules.default
{
services.sneemok = {
enable = true;
};
}
];
};
};
}Then rebuild:
sudo nixos-rebuild switch --flake .#yourhostnamesystemctl --user start sneemok
systemctl --user stop sneemok
systemctl --user status sneemok
systemctl --user restart sneemokView logs:
journalctl --user -u sneemok -fOnce the service is running:
# Trigger a screenshot
sneemok --screenshot
# Or just
sneemokAdd to your compositor config (e.g., Hyprland):
bind = $mainMod, P, exec, sneemok
bind = $mainMod SHIFT, P, exec, sneemok --screenshot
Or in sway:
bindsym $mod+p exec sneemok
bindsym $mod+Shift+p exec sneemok --screenshot
Service won't start:
# Check logs
journalctl --user -u sneemok -n 50
# Check if D-Bus session bus is available
echo $DBUS_SESSION_BUS_ADDRESS
# Check if compositor is running
echo $WAYLAND_DISPLAYScreenshots not triggering:
# Test D-Bus connection manually
dbus-send --session --print-reply \
--dest=org.sneemok.Service \
/org/sneemok/service \
org.sneemok.Service.ScreenshotService keeps restarting:
# Check what's failing
systemctl --user status sneemok
journalctl --user -u sneemok -fCommon issues:
- XDG Desktop Portal not available → Install xdg-desktop-portal-hyprland or equivalent
- Compositor not running → Service requires graphical session
- D-Bus session bus not available → Check session setup
Manually:
systemctl --user disable --now sneemokHome Manager:
services.sneemok.enable = false;NixOS:
services.sneemok.enable = false;With Nix:
nix buildWithout Nix:
zig builds- Selection toola- Arrowr- Rectanglec- Circlel- LineCtrl+C- Copy to clipboardESC- Change current tool to selection or exitMouse wheel up- Increase thickness of the current toolMouse wheel down- Decrease thickness of the current tool
- Drag to create selection/draw
- Resize handles on selection
- Click inside to move
src/
├── main.zig # Events, signals and threading of the D-Bus handler
├── state.zig # Application state
├── wayland.zig # Wayland-related objects
├── dbus.zig # Dbus struct with connection initialization, requesting and parsing screenshot from portal
├── output.zig # Rendering
├── canvas/ # Image + elements
└── tools/ # Selection + drawing tools
Rendering: Screenshot → Overlay → Selection → Elements → Tool UI
Format: BGRA internally, RGBA PNG export
Clipboard: Native Wayland
MIT