Dev
This commit is contained in:
32
qtile/scripts/wayland/screenshot.sh
Executable file
32
qtile/scripts/wayland/screenshot.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# ____ _ _
|
||||
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
|
||||
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
|
||||
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
|
||||
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
|
||||
#
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
DIR="$HOME/Pictures/screenshots/"
|
||||
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
||||
|
||||
option2="Selected area"
|
||||
option3="Fullscreen (delay 3 sec)"
|
||||
|
||||
options="$option2\n$option3"
|
||||
|
||||
choice=$(echo -e "$options" | rofi -dmenu -config ~/dotfiles/rofi/config-screenshot.rasi -i -no-show-icons -l 2 -width 30 -p "Take Screenshot")
|
||||
|
||||
case $choice in
|
||||
$option2)
|
||||
grim -g "$(slurp)" - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Selected area"
|
||||
;;
|
||||
$option3)
|
||||
sleep 3
|
||||
grim - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Fullscreen"
|
||||
;;
|
||||
esac
|
||||
78
qtile/scripts/wayland/wallpaper.sh
Executable file
78
qtile/scripts/wayland/wallpaper.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# _ _
|
||||
# __ ____ _| | |_ __ __ _ _ __ ___ _ __
|
||||
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
|
||||
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
|
||||
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
|
||||
# |_| |_|
|
||||
#
|
||||
# by Stephan Raabe (2023)
|
||||
# -----------------------------------------------------
|
||||
|
||||
case $1 in
|
||||
|
||||
# Load wallpaper from .cache of last session
|
||||
"init")
|
||||
if [ -f ~/.cache/current_wallpaper.jpg ]; then
|
||||
wal -q -i ~/.cache/current_wallpaper.jpg
|
||||
else
|
||||
wal -q -i ~/wallpaper/
|
||||
fi
|
||||
;;
|
||||
|
||||
# Select wallpaper with rofi
|
||||
"select")
|
||||
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi)
|
||||
if [ ! "$selected" ]; then
|
||||
echo "No wallpaper selected"
|
||||
exit
|
||||
fi
|
||||
wal -q -i ~/wallpaper/$selected
|
||||
;;
|
||||
|
||||
# Randomly select wallpaper
|
||||
*)
|
||||
wal -q -i ~/wallpaper/
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Load current pywal color scheme
|
||||
# -----------------------------------------------------
|
||||
source "$HOME/.cache/wal/colors.sh"
|
||||
echo "Wallpaper: $wallpaper"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Copy selected wallpaper into .cache folder
|
||||
# -----------------------------------------------------
|
||||
cp $wallpaper ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# -----------------------------------------------------
|
||||
# get wallpaper iamge name
|
||||
# -----------------------------------------------------
|
||||
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set the new wallpaper
|
||||
# -----------------------------------------------------
|
||||
swww init
|
||||
|
||||
transition_type="wipe"
|
||||
# transition_type="outer"
|
||||
# transition_type="random"
|
||||
|
||||
swww img $wallpaper \
|
||||
--transition-bezier .43,1.19,1,.4 \
|
||||
--transition-fps=60 \
|
||||
--transition-type=$transition_type \
|
||||
--transition-duration=0.7 \
|
||||
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Send notification
|
||||
# -----------------------------------------------------
|
||||
notify-send "Colors and Wallpaper updated" "with image $newwall"
|
||||
|
||||
echo "DONE!"
|
||||
Reference in New Issue
Block a user