A lightweight, menu-driven screenshot script written in Bash.
It allows you to:
- Take area or full-screen screenshots
- Automatically copy screenshots to the clipboard
- Optionally rename screenshots
- Use the best available menu UI (
zenity,rofi, ordmenu) - Fall back to terminal prompts if no GUI menu is available
Although this script was created for i3wm, it works on any Linux window manager or desktop environment.
- Area or full screen screenshots
- Clipboard support (PNG)
- Optional rename prompt
- Automatically chooses the best available UI:
zenity→rofi→dmenu→ terminal
- Screenshots saved with timestamps
By default, screenshots are saved to:
~/Pictures/screenshot/
Each file is named like:
screenshot_YYYY-MM-DD_HH-MM-SS.png
Make sure the following tools are installed:
| Tool | Purpose |
|---|---|
bash |
Shell interpreter |
maim |
Taking screenshots |
xclip |
Clipboard support |
notify-send (libnotify) |
Desktop notifications |
| Tool | Notes |
|---|---|
zenity |
GTK dialog — recommended for GNOME-adjacent setups |
rofi |
Keyboard-driven launcher — popular in i3wm |
dmenu |
Suckless minimal menu |
The included setup.sh provides a TUI wizard that:
- Auto-detects your Linux distribution and package manager
- Installs all required dependencies
- Installs
screenshotto~/.local/bin/ - Optionally configures an i3wm keybinding
git clone https://github.com/your-username/screenshot.git
cd screenshot
chmod +x setup.sh
./setup.sh
setup.shuseswhiptail(pre-installed on most distros) for its TUI, with automatic fallback todialog, then plain terminal prompts.
Supported package managers: pacman · apt · dnf · zypper · xbps
Arch Linux
sudo pacman -S maim xclip libnotify rofiDebian / Ubuntu
sudo apt install maim xclip libnotify-bin rofiFedora
sudo dnf install maim xclip libnotify rofiopenSUSE
sudo zypper install maim xclip libnotify-tools rofiVoid Linux
sudo xbps-install maim xclip libnotify rofimkdir -p ~/.local/bin
cp screenshot.sh ~/.local/bin/screenshot
chmod +x ~/.local/bin/screenshotEnsure ~/.local/bin is on your PATH (add to ~/.bashrc or ~/.zshrc if needed):
export PATH="$HOME/.local/bin:$PATH"Add to ~/.config/i3/config:
bindsym Print exec --no-startup-id screenshot
Then reload i3:
$mod + Shift + R
Run directly:
screenshotOr press your configured keybind in i3wm (default: Print).
A menu will appear letting you choose Area or Full Screen. After the screenshot is taken you will be asked whether to rename the file. The image is automatically copied to your clipboard.