rofi screenshot

This commit is contained in:
Anish L 2022-09-02 01:12:18 +10:00
parent 496936184a
commit 83877313be
5 changed files with 105 additions and 7 deletions

View file

@ -38,7 +38,6 @@
file
lsof
atool
inotify-tools
strace
zip
unzip
@ -50,15 +49,12 @@
less
gdb
xxd
kitty
taskwarrior
yt-dlp
gnupg
syncthing
dijo
flameshot
#ssb-patchwork
libreoffice
fontconfig
pandoc
];

View file

@ -1,3 +1,53 @@
#!/usr/bin/env sh
scrot ~/screenshots/%b%d::%H%M%S.png;
xclip -i < ~/screenshots/%b%d::%H%M%S.png;
#!/usr/bin/env bash
timer=5
# Options
select="麗"
window="类"
screen=""
delay=""
cancel=""
# Variable passed to rofi
options="$select\n$window\n$screen\n$delay\n$cancel"
rofi_command="rofi -theme theme/screenshotsmenu.rasi"
setFilename() {
directory="/tmp/"
filename="IMG_$(date +%Y%m%d_%H%M%S).jpg"
filepath=$directory$filename
}
notify() {
dunstify "Screenshot saved and copied to clipboard" -i accessories-screenshot
}
chosen="$(echo -e "$options" | $rofi_command -dmenu)"
case $chosen in
$select)
setFilename
maim -Buosd 0.25 \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$window)
setFilename
maim -Buod 0.25 -i $(xdotool getactivewindow) \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$screen)
setFilename
maim -Buod 0.25 \
| tee $filepath | xclip -selection c -t image/png
notify
;;
$delay)
setFilename
maim -Buod $timer \
| tee $filepath | xclip -selection c -t image/png
notify
;;
esac

View file

@ -26,6 +26,10 @@ in
qt5ct
gtk-engine-murrine
gtk_engines
maim
kitty
libreoffice
inotify-tools
];
xresources.properties = {

View file

@ -0,0 +1,43 @@
@import "config.rasi"
* {
icon-font : "Iosevka Nerd Font Mono 24";
text-color : @fg;
background-color : @bg;
margin : 0px;
padding : 0px;
spacing : 0px;
}
window {
location : north;
children : [mainbox];
}
mainbox {
children : [listview];
}
listview {
columns : 8;
lines : 1;
}
element {
children : [element-text];
}
element-text {
font : @icon-font;
cursor : pointer;
padding : 4px;
vertical-align : 0.5;
horizontal-align : 0.5;
}
element-text selected {
text-color : @bg;
background-color : @accent;
}

View file

@ -0,0 +1,5 @@
@import "iconmenu.rasi"
* { icon-font: "Iosevka Nerd Font Mono 24"; }
window { width: 264px; }