aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2024-05-23 12:16:52 +0900
committerGitHub <noreply@github.com>2024-05-23 12:16:52 +0900
commit074d06e3b51760edc2ca62ec198bba205eeb0bbf (patch)
tree6e672cccd7e4d9aea17c9abbe81349c654c9bdb9
parent0054b0b766d62112c4b096b61f8777a402bff08a (diff)
parentf34a6bf1006bcd3b2584ec69c2ca7ab30b517bc0 (diff)
Merge pull request #296 from JosephArmas/rofi-calc-baedot
New Feature: Rofi calculator
-rw-r--r--config/hypr/configs/Keybinds.conf1
-rwxr-xr-xconfig/hypr/scripts/RofiCalc.sh24
-rw-r--r--config/rofi/config-calc.rasi16
3 files changed, 41 insertions, 0 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf
index 142de86a..16155903 100644
--- a/config/hypr/configs/Keybinds.conf
+++ b/config/hypr/configs/Keybinds.conf
@@ -23,6 +23,7 @@ bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh
bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # Small help file
bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi
bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh # emoji
+bind = $mainMod ALT, C, exec, $scriptsDir/RofiCalc.sh # calculator (qalculate)
bind = $mainMod, S, exec, $scriptsDir/RofiSearch.sh # Google search from Rofi
bind = $mainMod SHIFT, B, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings
bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # animations ON/OFF
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
diff --git a/config/rofi/config-calc.rasi b/config/rofi/config-calc.rasi
new file mode 100644
index 00000000..5924a11d
--- /dev/null
+++ b/config/rofi/config-calc.rasi
@@ -0,0 +1,16 @@
+/* ---- 💫 https://github.com/JaKooLit 💫 ---- */
+/* Main Config Calculator */
+/* Submitted by: https://github.com/JosephArmas */
+
+@import "~/.config/rofi/config.rasi"
+
+/* ---- Entry ---- */
+entry {
+ width: 27%;
+ placeholder: "🧮 Calculate";
+}
+
+/* ---- Window ---- */
+window {
+ width: 30%;
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage