Add Scrot script file
This commit is contained in:
parent
a500df36b0
commit
ab7f23f26a
|
@ -99,6 +99,8 @@ keys = [
|
||||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||||
|
|
||||||
|
Key([mod], "Print", lazy.spawn("/home/raabe/dotfiles/scripts/scrot.sh")),
|
||||||
|
|
||||||
# Size
|
# Size
|
||||||
# Key([mod], "h", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall)'),
|
# Key([mod], "h", lazy.layout.shrink(), lazy.layout.decrease_nmaster(), desc='Shrink window (MonadTall)'),
|
||||||
# Key([mod], "l", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall)'),
|
# Key([mod], "l", lazy.layout.grow(), lazy.layout.increase_nmaster(), desc='Expand window (MonadTall)'),
|
||||||
|
@ -194,19 +196,19 @@ layout_theme = {
|
||||||
|
|
||||||
layouts = [
|
layouts = [
|
||||||
# layout.Columns(),
|
# layout.Columns(),
|
||||||
# layout.Max(),
|
layout.Max(**layout_theme),
|
||||||
# Try more layouts by unleashing below layouts.
|
# Try more layouts by unleashing below layouts.
|
||||||
# layout.Stack(num_stacks=2),
|
# layout.Stack(num_stacks=2),
|
||||||
# layout.Bsp(),
|
# layout.Bsp(),
|
||||||
# layout.Matrix(),
|
# layout.Matrix(),
|
||||||
layout.MonadTall(**layout_theme),
|
layout.MonadTall(**layout_theme),
|
||||||
# layout.MonadWide(),
|
layout.MonadWide(**layout_theme),
|
||||||
# layout.RatioTile(),
|
layout.RatioTile(**layout_theme),
|
||||||
# layout.Tile(),
|
# layout.Tile(),
|
||||||
# layout.TreeTab(),
|
# layout.TreeTab(),
|
||||||
# layout.VerticalTile(),
|
# layout.VerticalTile(),
|
||||||
# layout.Zoomy(),
|
# layout.Zoomy(),
|
||||||
layout.Floating(**layout_theme)
|
# layout.Floating(**layout_theme)
|
||||||
]
|
]
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
31
scripts/scrot.sh
Executable file
31
scripts/scrot.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# ____ _ _
|
||||||
|
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
|
||||||
|
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
|
||||||
|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
|
||||||
|
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# by Stephan Raabe (2023)
|
||||||
|
# -----------------------------------------------------
|
||||||
|
|
||||||
|
DIR="$HOME/Pictures/screenshots/"
|
||||||
|
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
||||||
|
|
||||||
|
option1="Selected window (delay 3 sec)"
|
||||||
|
option2="Selected area"
|
||||||
|
option3="Fullscreen (delay 3 sec)"
|
||||||
|
|
||||||
|
options="$option1\n$option2\n$option3"
|
||||||
|
|
||||||
|
choice=$(echo -e "$options" | rofi -mesg "Current: $DIR" -i -dmenu -lines 4 -width 30 -p "Screenshot")
|
||||||
|
|
||||||
|
case $choice in
|
||||||
|
$option1)
|
||||||
|
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f' -c -z -u;;
|
||||||
|
$option2)
|
||||||
|
scrot $DIR$NAME -s -e 'xclip -selection clipboard -t image/png -i $f';;
|
||||||
|
|
||||||
|
$option3)
|
||||||
|
scrot $DIR$NAME -d 3 -e 'xclip -selection clipboard -t image/png -i $f';;
|
||||||
|
esac
|
|
@ -10,13 +10,15 @@
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
|
|
||||||
# Select wallpaper
|
# Select wallpaper
|
||||||
selected=$(ls -1 ~/wallpaper | rofi -dmenu -p "Select the wallpaper")
|
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -p "Select the wallpaper")
|
||||||
|
|
||||||
# Update wallpaper with pywal
|
if [ "$selected" ]; then
|
||||||
wal -q -i ~/wallpaper/$selected
|
# Update wallpaper with pywal
|
||||||
|
wal -q -i ~/wallpaper/$selected
|
||||||
|
|
||||||
# Wait for 1 sec
|
# Wait for 1 sec
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Reload qtile to color bar
|
# Reload qtile to color bar
|
||||||
qtile cmd-obj -o cmd -f reload_config
|
qtile cmd-obj -o cmd -f reload_config
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user