From 2618d4c9f429ecc02d913093f8a6259a6f5994a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 12 Nov 2021 14:14:13 +0100 Subject: [PATCH] Add calc mode --- rofi/config.rasi | 1 + rofi/material-ocean.rasi | 23 ++++++++++++++--------- rofi/show-calculator.sh | 11 +++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100755 rofi/show-calculator.sh diff --git a/rofi/config.rasi b/rofi/config.rasi index 8a52c2b..ab749a7 100644 --- a/rofi/config.rasi +++ b/rofi/config.rasi @@ -4,4 +4,5 @@ configuration { theme: "~/.config/rofi/material-ocean.rasi"; icon-theme: "Papirus"; kb-cancel: "Shift+Ctrl+Alt+F12,Escape,Alt+F1"; + combi-hide-mode-prefix: true; } diff --git a/rofi/material-ocean.rasi b/rofi/material-ocean.rasi index 4d3ffdc..ce334c0 100644 --- a/rofi/material-ocean.rasi +++ b/rofi/material-ocean.rasi @@ -16,14 +16,7 @@ window { background-color: @background; text-color: @foreground; width: 1000px; - height: 500px; -} - -prompt { - enabled: true; - padding: 10px 10px 15px 15px; - background-color: @background; - text-color: @foreground; + y-offset: -25%; } textbox-prompt-colon { @@ -69,15 +62,27 @@ listview { cycle: true; dynamic: true; layout: vertical; + fixed-height:false; + lines: 5; } mainbox { background-color: @background; - children: [ inputbar, listview ]; + children: [ inputbar, message, listview ]; spacing: 20px; padding: 20px 15px 15px 15px; } +message { + children: [ textbox ]; +} + +textbox { + background-color: @selected; + text-color: @foreground; + padding: 25px 6px 25px 80px; +} + element { background-color: @background; text-color: @foreground; diff --git a/rofi/show-calculator.sh b/rofi/show-calculator.sh new file mode 100755 index 0000000..596dadd --- /dev/null +++ b/rofi/show-calculator.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ -z "$1" ]]; then + echo "Show calculator" + +else + killall rofi + # so rofi doesn't complain "can't launch rofi inside rofi" + # rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xclip -selection clipboard" + rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xclip -selection clipboard" +fi