[feat] refactor
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk -F ' ' '{print $2}')
|
||||
|
||||
if [ $muted == "yes" ]; then
|
||||
echo "{\"alt\": \"mute\", \"class\": \"muted\", \"tooltip\": \"muted\"}"
|
||||
exit
|
||||
fi
|
||||
|
||||
VOL=$(pactl get-sink-volume @DEFAULT_SINK@ | grep Volume | awk -F' ' '{print $5}' | sed -e 's/%$//')
|
||||
|
||||
echo "{\"percentage\": $VOL, \"tooltip\": \"$VOL%\"}"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Get the picture from maim
|
||||
# flameshot gui -r > $HOME/.cache/src.png &
|
||||
grim -g "$(slurp)" $HOME/ramdisk/src.png &
|
||||
wait $!
|
||||
|
||||
# add shadow, round corner, border and watermark
|
||||
convert $HOME/ramdisk/src.png \
|
||||
\( +clone -alpha extract \
|
||||
-draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
|
||||
\( +clone -flip \) -compose Multiply -composite \
|
||||
\( +clone -flop \) -compose Multiply -composite \
|
||||
\) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
|
||||
|
||||
convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
|
||||
+swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
|
||||
|
||||
# composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
|
||||
|
||||
# Send the Picture to clipboard
|
||||
# xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
|
||||
wl-copy -t image/png < $HOME/ramdisk/des.png
|
||||
|
||||
# remove the other pictures
|
||||
rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Get the picture from maim
|
||||
# flameshot gui -r > $HOME/.cache/src.png &
|
||||
grim -g "$(slurp -or)" $HOME/ramdisk/src.png &
|
||||
wait $!
|
||||
|
||||
# add shadow, round corner, border and watermark
|
||||
convert $HOME/ramdisk/src.png \
|
||||
\( +clone -alpha extract \
|
||||
-draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \
|
||||
\( +clone -flip \) -compose Multiply -composite \
|
||||
\( +clone -flop \) -compose Multiply -composite \
|
||||
\) -alpha off -compose CopyOpacity -composite $HOME/ramdisk/output.png
|
||||
|
||||
convert $HOME/ramdisk/output.png -bordercolor none -border 20 \( +clone -background black -shadow 80x8+15+15 \) \
|
||||
+swap -background transparent -layers merge +repage $HOME/ramdisk/des.png
|
||||
|
||||
# composite -gravity South ~/.local/bin/watermark.png $HOME/ramdisk/des.png $HOME/ramdisk/des.png
|
||||
|
||||
# Send the Picture to clipboard
|
||||
# xclip -selection clipboard -t image/png -i $HOME/ramdisk/des.png
|
||||
wl-copy -t image/png < $HOME/ramdisk/des.png
|
||||
|
||||
# remove the other pictures
|
||||
rm $HOME/ramdisk/src.png $HOME/ramdisk/output.png
|
||||
Reference in New Issue
Block a user