лучше не лезьте
This commit is contained in:
54
rofi/volume/launch.sh
Executable file
54
rofi/volume/launch.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
theme_path="$HOME/.config/rofi/volume/volume_menu.rasi"
|
||||
|
||||
volume=''
|
||||
microphone=''
|
||||
pavucontrol=''
|
||||
|
||||
rofi_cmd() {
|
||||
rofi -theme "$theme_path" -dmenu -markup-rows
|
||||
}
|
||||
|
||||
# Microphone Info
|
||||
amixer get Capture | grep '\[on\]' &>/dev/null
|
||||
if [[ "$?" == 0 ]]; then
|
||||
microphone=''
|
||||
else
|
||||
microphone=''
|
||||
fi
|
||||
|
||||
# Microphone Info
|
||||
amixer get Master | grep '\[on\]' &>/dev/null
|
||||
if [[ "$?" == 0 ]]; then
|
||||
volume=''
|
||||
else
|
||||
volume=''
|
||||
fi
|
||||
|
||||
run_cmd() {
|
||||
if [[ "$1" == '--opt1' ]]; then
|
||||
amixer set Master toggle
|
||||
elif [[ "$1" == '--opt2' ]]; then
|
||||
amixer set Capture toggle
|
||||
elif [[ "$1" == '--opt3' ]]; then
|
||||
exec pavucontrol
|
||||
fi
|
||||
}
|
||||
|
||||
run() {
|
||||
echo -e "$volume\n$microphone\n$pavucontrol" | rofi_cmd
|
||||
}
|
||||
|
||||
chosen="$(run)"
|
||||
case ${chosen} in
|
||||
$volume)
|
||||
run_cmd --opt1
|
||||
;;
|
||||
$microphone)
|
||||
run_cmd --opt2
|
||||
;;
|
||||
$pavucontrol)
|
||||
run_cmd --opt3
|
||||
;;
|
||||
esac
|
||||
83
rofi/volume/volume_menu.rasi
Normal file
83
rofi/volume/volume_menu.rasi
Normal file
@@ -0,0 +1,83 @@
|
||||
/*****----- Configuration -----*****/
|
||||
configuration {
|
||||
show-icons: false;
|
||||
}
|
||||
|
||||
/*
|
||||
USE_BUTTONS=YES
|
||||
*/
|
||||
|
||||
@import "../colors.rasi"
|
||||
|
||||
/*****----- Main Window -----*****/
|
||||
window {
|
||||
transparency: "real";
|
||||
location: east;
|
||||
anchor: east;
|
||||
fullscreen: false;
|
||||
width: 80px;
|
||||
x-offset: -20px;
|
||||
y-offset: 0px;
|
||||
|
||||
padding: 0px;
|
||||
border: 0px solid;
|
||||
border-radius: 100%;
|
||||
border-color: @selected;
|
||||
cursor: "default";
|
||||
background-color: @background;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
background-color: transparent;
|
||||
children: [ "listview" ];
|
||||
}
|
||||
|
||||
inputbar {
|
||||
enable: true;
|
||||
background-color: transparent;
|
||||
children: [ "textbox-prompt-colon", "dummy", "prompt" ];
|
||||
}
|
||||
|
||||
promt {
|
||||
enable: false;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
textbox-prompt-colon {
|
||||
enable: false;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
dummy {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
listview {
|
||||
columns: 1;
|
||||
lines: 3;
|
||||
background-color: transparent;
|
||||
spacing: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
element {
|
||||
background-color: @background-alt;
|
||||
text-color: @foreground;
|
||||
border-radius: 100%;
|
||||
cursor: pointer;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
element-text {
|
||||
font: "FiraCode Nerd Font Propo 18";
|
||||
background-color: transparent;
|
||||
text-color: inherit;
|
||||
cursor: inherit;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
element selected.normal {
|
||||
background-color: @selected;
|
||||
text-color: @background;
|
||||
}
|
||||
Reference in New Issue
Block a user