Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-tools
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-tools
Commits
7a1bb25c
Verified
Commit
7a1bb25c
authored
Dec 22, 2024
by
Кирилл Уницаев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new tool: cliphist-wofi
parent
24635079
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
README.md
README.md
+3
-0
cliphist-wofi
bin/cliphist-wofi
+43
-0
makefile
makefile
+1
-1
No files found.
README.md
View file @
7a1bb25c
...
...
@@ -13,6 +13,9 @@ The set of utilities used in Ximper Linux includes various tools that help speed
Script for automatically starting applications that support XDG Autostart.
Necessary for window managers that do not support this specification.
### cliphist-wofi
Script for displaying clipboard menu with image support via wofi.
## License
MIT License
...
...
bin/cliphist-wofi
0 → 100644
View file @
7a1bb25c
#!/bin/bash
wofi_flags
=
"
$*
"
thumb_dir
=
"
${
XDG_CACHE_HOME
:-
$HOME
/.cache
}
/cliphist/thumbs"
mkdir
-p
"
$thumb_dir
"
cliphist_list
=
"
$(
cliphist list
)
"
for
thumb
in
"
$thumb_dir
"
/
*
;
do
clip_id
=
"
${
thumb
##*/
}
"
clip_id
=
"
${
clip_id
%.*
}
"
check
=
$(
rg
<<<
"
$cliphist_list
"
"^
$clip_id
\s
"
)
if
[
-z
"
$check
"
]
;
then
>
&2
rm
-v
"
$thumb
"
fi
done
read
-r
-d
''
prog
<<
EOF
/^[0-9]+\s<meta http-equiv=/ { next }
match(\
$0
, /^([0-9]+)\s(\[\[\s)?binary.*(jpg|jpeg|png|bmp)/, grp) {
image = grp[1]"."grp[3]
system("[ -f
$thumb_dir
/"image" ] || echo " grp[1] "\\\\\t | cliphist decode | magick - -resize '256x256>'
$thumb_dir
/"image )
print "img:
$thumb_dir
/"image
next
}
1
EOF
choice
=
$(
gawk
<<<
"
$cliphist_list
"
"
$prog
"
| wofi
-I
--dmenu
-Dimage_size
=
100
-Dynamic_lines
=
true
$wofi_flags
)
[
-z
"
$choice
"
]
&&
exit
1
if
[
"
${
choice
::4
}
"
=
"img:"
]
;
then
thumb_file
=
"
${
choice
:4
}
"
clip_id
=
"
${
thumb_file
##*/
}
"
clip_id
=
"
${
clip_id
%.*
}
\t
"
else
clip_id
=
"
${
choice
}
"
fi
printf
'%s'
"
$clip_id
"
| cliphist decode
makefile
View file @
7a1bb25c
...
...
@@ -2,7 +2,7 @@ prefix ?= /usr
bindir
?=
$(prefix)
/bin
DESTDIR
?=
EXECUTABLES
=
wm-xdg-autostart
EXECUTABLES
=
wm-xdg-autostart
cliphist-wofi
all
:
install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment