refactor: new system basics

This commit is contained in:
2025-05-29 18:18:25 +02:00
parent f4ea18dc1a
commit c0ca42d166
92 changed files with 190009 additions and 12 deletions

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