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";
icon-theme: "Papirus";
kb-cancel: "Shift+Ctrl+Alt+F12,Escape,Alt+F1";
combi-hide-mode-prefix: true;
}

View File

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

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