Add calc mode

This commit is contained in:
Thomas Avé 2021-11-12 14:14:13 +01:00
parent f96e07612b
commit 2618d4c9f4
3 changed files with 26 additions and 9 deletions

View File

@ -4,4 +4,5 @@ configuration {
theme: "~/.config/rofi/material-ocean.rasi"; theme: "~/.config/rofi/material-ocean.rasi";
icon-theme: "Papirus"; icon-theme: "Papirus";
kb-cancel: "Shift+Ctrl+Alt+F12,Escape,Alt+F1"; kb-cancel: "Shift+Ctrl+Alt+F12,Escape,Alt+F1";
combi-hide-mode-prefix: true;
} }

View File

@ -16,14 +16,7 @@ window {
background-color: @background; background-color: @background;
text-color: @foreground; text-color: @foreground;
width: 1000px; width: 1000px;
height: 500px; y-offset: -25%;
}
prompt {
enabled: true;
padding: 10px 10px 15px 15px;
background-color: @background;
text-color: @foreground;
} }
textbox-prompt-colon { textbox-prompt-colon {
@ -69,15 +62,27 @@ listview {
cycle: true; cycle: true;
dynamic: true; dynamic: true;
layout: vertical; layout: vertical;
fixed-height:false;
lines: 5;
} }
mainbox { mainbox {
background-color: @background; background-color: @background;
children: [ inputbar, listview ]; children: [ inputbar, message, listview ];
spacing: 20px; spacing: 20px;
padding: 20px 15px 15px 15px; padding: 20px 15px 15px 15px;
} }
message {
children: [ textbox ];
}
textbox {
background-color: @selected;
text-color: @foreground;
padding: 25px 6px 25px 80px;
}
element { element {
background-color: @background; background-color: @background;
text-color: @foreground; text-color: @foreground;

11
rofi/show-calculator.sh Executable file
View File

@ -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