Browse Source

Merge pull request #296 from JosephArmas/rofi-calc-baedot

New Feature: Rofi calculator
pull/298/head
Ja.KooLit 2 years ago committed by GitHub
parent
commit
074d06e3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      config/hypr/configs/Keybinds.conf
  2. 24
      config/hypr/scripts/RofiCalc.sh
  3. 16
      config/rofi/config-calc.rasi

1
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

24
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

16
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%;
}
Loading…
Cancel
Save