From a36aadab60c09bff3a055b0442971aa5e8a87a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 18 May 2022 01:17:06 +0300 Subject: WIP: rofi * Moved basically all menu scripts to use rofi * Updated some custom desktop entries * Updated list of packages. TODO: make a better installer script/package list. * Removed some old and extraneous scripts. * Other minor changes to config. --- dotfiles/.local/bin/screensht | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 dotfiles/.local/bin/screensht (limited to 'dotfiles/.local/bin/screensht') diff --git a/dotfiles/.local/bin/screensht b/dotfiles/.local/bin/screensht new file mode 100755 index 0000000..f170d38 --- /dev/null +++ b/dotfiles/.local/bin/screensht @@ -0,0 +1,51 @@ +#!/bin/sh + +notify_saved() { + notify-send -i "$1" "🖼 Screenshot" "Screenshot has been saved in $1" ; +} + +notify_copied() { + notify-send "🖼 Screenshot" "Screenshot has been copied to clipboard" ; +} + +if [ "$2" = "copy" ]; then + case "$1" in + "select area") + grim -g "$(slurp)" - | wl-copy + notify_copied + ;; + "current window") + grim -g "$(swaygetcurrentwindow)" - | wl-copy + notify_copied + ;; + "full screen") + grim - | wl-copy + notify_copied + ;; + *) exit 0;; + esac + exit 0 +else + if ! [ -d $SCROT_DIR ]; then + mkdir -p $SCROT_DIR + fi + case "$1" in + "select area") + scrpath="$SCROT_DIR/selected-$(date '+%y%m%d-%H%M-%S').png" + grim -g "$(slurp)" "$scrpath" + notify_saved "$scrpath" + ;; + "current window") + scrpath="$SCROT_DIR/window-$(date '+%y%m%d-%H%M-%S').png" + grim -g "$(swaygetcurrentwindow)" "$scrpath" + notify_saved "$scrpath" + ;; + "full screen") + scrpath="$SCROT_DIR/fullscreen-$(date '+%y%m%d-%H%M-%S').png" + grim "$scrpath" + notify_saved "$scrpath" + ;; + *) exit 0;; + esac + exit 0 +fi -- cgit v1.2.3