New backup 2026-03-03 08:30:02
This commit is contained in:
parent
77599da70f
commit
d40d2cbaa1
2 changed files with 35 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ bindsym {
|
|||
#file browser
|
||||
$mod+shift+f exec 'sdu launch --program filemanager'
|
||||
#calculator
|
||||
$mod+c exec wofi-calc
|
||||
$mod+c exec "$HOME/.config/sway/scripts/wofi-calc.sh"
|
||||
#sticky notes
|
||||
$mod+shift+m exec stickynotes
|
||||
#gocryptfs
|
||||
|
|
|
|||
34
de/home/.config/sway/scripts/wofi-calc.sh
Executable file
34
de/home/.config/sway/scripts/wofi-calc.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
RESULT_FILE="$HOME/.config/qalculate/qalc.result.history"
|
||||
if [ ! -f "$RESULT_FILE" ]; then
|
||||
touch $RESULT_FILE
|
||||
fi
|
||||
|
||||
LAST_WOFI=""
|
||||
QALC_RET=""
|
||||
while :
|
||||
do
|
||||
qalc_hist=`tac $RESULT_FILE | head -1000`
|
||||
WOFI_RET=`wofi --sort-order=default --cache-file=/dev/null -d -p calc <<< "$qalc_hist"`
|
||||
|
||||
rtrn=$?
|
||||
|
||||
if test "$rtrn" = "0"; then
|
||||
if [[ "$WOFI_RET" =~ .*=.* ]]; then
|
||||
RESULT=`echo "$WOFI_RET" | awk {'print $NF'}`
|
||||
wl-copy "$RESULT"
|
||||
exit 0
|
||||
else
|
||||
QALC_RET=`qalc "$WOFI_RET"`
|
||||
LAST_WOFI=$WOFI_RET
|
||||
echo $QALC_RET >> $RESULT_FILE
|
||||
fi
|
||||
else
|
||||
if [ ! -z "$LAST_WOFI" ]; then
|
||||
RESULT=`qalc -t "$LAST_WOFI"`
|
||||
wl-copy "$RESULT"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Reference in a new issue