Skip to content

Feature: Enhanced Calculator (rofi-calc plugin)#58

Open
Mr-Hasan-Hamid wants to merge 6 commits into
LinuxBeginnings:developmentfrom
Mr-Hasan-Hamid:feat-calculator-dev
Open

Feature: Enhanced Calculator (rofi-calc plugin)#58
Mr-Hasan-Hamid wants to merge 6 commits into
LinuxBeginnings:developmentfrom
Mr-Hasan-Hamid:feat-calculator-dev

Conversation

@Mr-Hasan-Hamid
Copy link
Copy Markdown

@Mr-Hasan-Hamid Mr-Hasan-Hamid commented May 12, 2026

Replaces the clunky bash RofiCalc.sh script with the native rofi-calc plugin for zero-latency live results and complex math support. Includes a custom Rasi theme.

Preview

Note: Re-submitted against the development branch as requested.

Copilot AI review requested due to automatic review settings May 12, 2026 02:46
@dwilliam62 dwilliam62 self-assigned this May 12, 2026
@dwilliam62 dwilliam62 added the enhancement New feature or request label May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the existing bash-based calculator launcher with the native rofi-calc mode and updates the calculator Rasi override to better suit live calculation + history display in rofi.

Changes:

  • Reworked config-calc.rasi to configure rofi’s calc mode and adjust layout (input/message/history styling).
  • Removed the old RofiCalc.sh loop that called qalc and copied results to the clipboard.
  • Updated the Hyprland keybind to invoke rofi -show calc directly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
config/rofi/config-calc.rasi Adds rofi-calc configuration + UI overrides for calculator mode (input/message/history).
config/hypr/UserScripts/RofiCalc.sh Removes the old rofi+dmenu+qalc calculator script.
config/hypr/configs/Keybinds.conf Switches the calculator keybind from the script to a direct rofi -show calc invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/rofi/config-calc.rasi Outdated
Comment thread config/hypr/configs/Keybinds.conf Outdated
bindlnd = ALT_L, SHIFT_L, switch keyboard layout globally, exec, $scriptsDir/KeyboardLayout.sh switch
bindlnd = SHIFT_L, ALT_L, switch keyboard layout per-window, exec, $scriptsDir/Tak0-Per-Window-Switch.sh
bindd = $mainMod ALT, C, calculator, exec, $UserScripts/RofiCalc.sh
bindd = $mainMod ALT, C, calculator (rofi-calc), exec, rofi -show calc -modi calc -no-show-match -no-sort -config ~/.config/rofi/config-calc.rasi
@dwilliam62
Copy link
Copy Markdown
Contributor

Thank you. Sorry to make you re-do it. One suggestion. When you update something like a menu or GUI post a screenshot also. That is very helpful I'll have to check out the theme, b/c we prefer it to follow the existing themes for consistency. But I'll check it out Thx

dwilliam62 and others added 2 commits May 11, 2026 22:51
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dwilliam62
Copy link
Copy Markdown
Contributor

Thx. sorry but that theme doesn't work for me. Too different from existing themes for rofi

@dwilliam62
Copy link
Copy Markdown
Contributor

And again you are pulling from Jak's repo not ours
image

@Mr-Hasan-Hamid
Copy link
Copy Markdown
Author

@dwilliam62 I apologize for that! You are completely right—I accidentally copied over my local config-calc.rasi which still had the old JaKooLit header and a bunch of bloated UI overrides.

I just pushed a fix that completely reverts the theme back to the pristine LinuxBeginnings style. The only changes made to your original config-calc.rasi are:

  1. Re-enabling the listview so the calculator history actually displays.
  2. Adding it to the mainbox children so the results show up below the prompt without breaking your design language.

Thank you for catching that!

What I changed

•  Restored config/hypr/UserScripts/RofiCalc.sh (no longer deleted).
•  Added wl-copy behavior back in that script after qalc evaluation.
•  Repointed calculator keybind in config/hypr/configs/Keybinds.conf to:
◦  bindd = $mainMod ALT, C, calculator, exec, $UserScripts/RofiCalc.sh
•  Removed PR custom calculator theming from config/rofi/config-calc.rasi and reduced it to use the normal/global rofi theme flow (@import "~/.config/rofi/config.rasi" with minimal calc mode config).

This effectively reverts the PR’s custom calc UI override and restores script-based calculator behavior with clipboard copy.

 On branch pr-58-test
 Your branch is up to date with 'origin/feat-calculator-dev'.

 Changes to be committed:
	new file:   config/hypr/UserScripts/RofiCalc.sh
	modified:   config/hypr/configs/Keybinds.conf
	modified:   config/rofi/config-calc.rasi
@Mr-Hasan-Hamid
Copy link
Copy Markdown
Author

@dwilliam62 Ah, that makes complete sense. I didn't realize the new Lua architecture was strictly bound to the RofiCalc.sh file path, nor did I consider the edge case of launching it while another Rofi instance was active.

Thank you for taking the time to test it so thoroughly and patching it up to fit the project's UX standards (especially restoring the clipboard functionality). Your changes look great, and I completely understand why you reverted the custom theme to maintain consistency across the ecosystem.

Feel free to merge your adjusted version whenever it fits into your workflow, or close this out if you'd prefer to just keep the original script as-is for the Lua transition. Thanks again for the detailed review and feedback!

@dwilliam62
Copy link
Copy Markdown
Contributor

I do like this. I will need to update all the distro installers as well. TBH I am tempted to replace it with a flatpak. And have a "real" calculator. Then users could actually chose their own as well. IDK. Something to think about. Thanks again but for sure this is better than what we have today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants