refactor: new system basics

This commit is contained in:
dqnid committed 2025-05-29 18:18:25 +02:00
1 parent f4ea18dc1a
commit c0ca42d166
92 files changed
+190009 -12

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
HISTORY_LENGTH=8
HISTORY_FILE_PATH=~/.tmp/clipboard_history.txt
touch $HISTORY_FILE_PATH >/dev/null
while clipnotify; do
new_clip=$(xsel -b -o)
is_found=$(grep -Fx "$new_clip" $HISTORY_FILE_PATH)
if [ ${#is_found} -eq 0 ]; then
echo "$new_clip" >> $HISTORY_FILE_PATH
file_size=$(wc -l < $HISTORY_FILE_PATH)
if [ $file_size -gt $HISTORY_LENGTH ]; then
sed -i '1d' $HISTORY_FILE_PATH
fi
fi
done