diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2024-05-23 12:16:52 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 12:16:52 +0900 |
| commit | 074d06e3b51760edc2ca62ec198bba205eeb0bbf (patch) | |
| tree | 6e672cccd7e4d9aea17c9abbe81349c654c9bdb9 /config/hypr/scripts/RofiCalc.sh | |
| parent | 0054b0b766d62112c4b096b61f8777a402bff08a (diff) | |
| parent | f34a6bf1006bcd3b2584ec69c2ca7ab30b517bc0 (diff) | |
Merge pull request #296 from JosephArmas/rofi-calc-baedot
New Feature: Rofi calculator
Diffstat (limited to 'config/hypr/scripts/RofiCalc.sh')
| -rwxr-xr-x | config/hypr/scripts/RofiCalc.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh new file mode 100755 index 00000000..ff96b3a8 --- /dev/null +++ b/config/hypr/scripts/RofiCalc.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# /* Calculator (using qalculate) and rofi */ +# /* Submitted by: https://github.com/JosephArmas */ + +rofi_config="$HOME/.config/rofi/config-calc.rasi" + + +while true; do + result=$( + rofi -i -dmenu \ + -config "$rofi_config" \ + -mesg "$result = $calc_result" + ) + + if [ $? -ne 0 ]; then + exit + fi + + if [ -n "$result" ]; then + calc_result=$(qalc -t "$result") + echo "$calc_result" | wl-copy + fi +done |
