Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot

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, or dmenu)
  • 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.


Features

  • 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

Screenshot Save Location

By default, screenshots are saved to:

~/Pictures/screenshot/

Each file is named like:

screenshot_YYYY-MM-DD_HH-MM-SS.png

Prerequisites

Make sure the following tools are installed:

Required

Tool Purpose
bash Shell interpreter
maim Taking screenshots
xclip Clipboard support
notify-send (libnotify) Desktop notifications

Optional (any one is enough for the menu UI)

Tool Notes
zenity GTK dialog — recommended for GNOME-adjacent setups
rofi Keyboard-driven launcher — popular in i3wm
dmenu Suckless minimal menu

Installation

Automated Setup (recommended)

The included setup.sh provides a TUI wizard that:

  • Auto-detects your Linux distribution and package manager
  • Installs all required dependencies
  • Installs screenshot to ~/.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.sh uses whiptail (pre-installed on most distros) for its TUI, with automatic fallback to dialog, then plain terminal prompts.

Supported package managers: pacman · apt · dnf · zypper · xbps


Manual Installation

1. Install dependencies

Arch Linux

sudo pacman -S maim xclip libnotify rofi

Debian / Ubuntu

sudo apt install maim xclip libnotify-bin rofi

Fedora

sudo dnf install maim xclip libnotify rofi

openSUSE

sudo zypper install maim xclip libnotify-tools rofi

Void Linux

sudo xbps-install maim xclip libnotify rofi

2. Install the script

mkdir -p ~/.local/bin
cp screenshot.sh ~/.local/bin/screenshot
chmod +x ~/.local/bin/screenshot

Ensure ~/.local/bin is on your PATH (add to ~/.bashrc or ~/.zshrc if needed):

export PATH="$HOME/.local/bin:$PATH"

3. Configure i3wm keybinding (optional)

Add to ~/.config/i3/config:

bindsym Print exec --no-startup-id screenshot

Then reload i3:

$mod + Shift + R

Usage

Run directly:

screenshot

Or 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.


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages