Command input field

This commit is contained in:
Candifloss 2025-01-09 00:23:29 +05:30
parent 0ef723038b
commit 5fd5fc094b
6 changed files with 65 additions and 3 deletions

13
eww.css
View File

@ -145,3 +145,16 @@ tooltip {
.panel_mini_widg.panel_ico.panel_weather_ico {
font-size: 22px;
}
/* Command prompt widget */
.executioner {
border-radius: 5px;
background-color: rgba(128, 128, 128, 0.5);
}
.cmd_input_field {
border-radius: 5px;
background-color: rgba(128, 128, 128, 0.5);
padding: 5px;
margin: 10px;
}

View File

@ -3,3 +3,4 @@
(include "yuck/osd/osd_window.yuck")
(include "yuck/dock/dock_window.yuck")
(include "yuck/panel/panel_window.yuck")
(include "yuck/exec_cmd/executioner.yuck")

14
scss/cmd/_cmd.scss Normal file
View File

@ -0,0 +1,14 @@
@use "../colors/_glassy.scss" as *;
/* Command prompt widget */
.executioner {
border-radius: 5px;
background-color: $dock_bg_col;
}
.cmd_input_field {
border-radius: 5px;
background-color: $dock_bg_col;
padding: 5px;
margin: 10px;
}

View File

@ -3,6 +3,7 @@
@use "osd/_osd.scss";
@use "dock/_dock.scss";
@use "panel/_panel.scss";
@use "cmd/cmd";
//@use "colors/_glassy.scss";

View File

@ -1,8 +1,8 @@
#!/bin/bash
vol=$(amixer get Master | grep "Mono: Playback" | sed -n 's/.*Mono: Playback [0-9]* \[\([0-9]*\)%\].*\[\(.*\)\]/\1 \2/p')
v=${vol%% *} # Volume percentage (18%)
s=${vol#* } # Mute status (on/off)
v=${vol%% *} # Volume percentage
s=${vol#* } # Volume status (on/off)
if [[ $v == '0' ]]; then
s="empty";

View File

@ -0,0 +1,33 @@
; Command prompt
(defwindow executioner []
:geometry (
geometry
:x "0%"
:y "0%"
:height "70px"
:width "300px"
:anchor "center center"
)
:monitor 0
:stacking "fg"
:windowtype "dock"
:wm-ignore true
:active true
:focusable true
:class "cmd_window"
(cmd_input)
)
(defwidget cmd_input []
(input
:class "cmd_input_field"
:active true
:halign "fill"
:height "70px"
:width "300px"
:value "cmd:"
:password false
:onaccept "fish {}"
)
)