From 40fb30c13b3e0e80174066b7ccf2dd88fe2a9666 Mon Sep 17 00:00:00 2001 From: JosephArmas Date: Wed, 22 May 2024 13:41:48 -0700 Subject: feat: Add rofi calculator using qalc command. Result of expression is automatically saved to clipboard. Default keybinding set to mod + alt + c. --- config/hypr/scripts/RofiCalc.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 config/hypr/scripts/RofiCalc.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh new file mode 100755 index 00000000..3589525f --- /dev/null +++ b/config/hypr/scripts/RofiCalc.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +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 -- cgit v1.2.3 From a3bf20a92a091fe240d530c42b61437301571160 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Thu, 23 May 2024 12:15:06 +0900 Subject: Update RofiCalc.sh --- config/hypr/scripts/RofiCalc.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh index 3589525f..d908e2b1 100755 --- a/config/hypr/scripts/RofiCalc.sh +++ b/config/hypr/scripts/RofiCalc.sh @@ -1,4 +1,7 @@ #!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# /* Calculator (using qualculate) and rofi */ +# /* Submitted by: https://github.com/JosephArmas */ rofi_config="$HOME/.config/rofi/config-calc.rasi" -- cgit v1.2.3 From f34a6bf1006bcd3b2584ec69c2ca7ab30b517bc0 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Thu, 23 May 2024 12:16:02 +0900 Subject: Update RofiCalc.sh --- config/hypr/scripts/RofiCalc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiCalc.sh b/config/hypr/scripts/RofiCalc.sh index d908e2b1..ff96b3a8 100755 --- a/config/hypr/scripts/RofiCalc.sh +++ b/config/hypr/scripts/RofiCalc.sh @@ -1,6 +1,6 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ -# /* Calculator (using qualculate) and rofi */ +# /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ rofi_config="$HOME/.config/rofi/config-calc.rasi" -- cgit v1.2.3