Mic handling script with polybar integration
This commit is contained in:
parent
40f78e442c
commit
a031cd1636
|
@ -154,3 +154,5 @@ hi Search cterm=NONE ctermbg=blue ctermfg=black
|
||||||
highlight LineNr ctermbg=none ctermfg=8
|
highlight LineNr ctermbg=none ctermfg=8
|
||||||
highlight CursorLineNr ctermbg=18 ctermfg=gray
|
highlight CursorLineNr ctermbg=18 ctermfg=gray
|
||||||
hi IndentGuidesEven ctermbg=18
|
hi IndentGuidesEven ctermbg=18
|
||||||
|
|
||||||
|
hi Normal ctermbg=NONE
|
||||||
|
|
36
de/bar/mic.bash
Executable file
36
de/bar/mic.bash
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
pidfile="/var/run/user/$UID/polybar-mic-script.pid"
|
||||||
|
|
||||||
|
if [ -e "$pidfile" ]; then
|
||||||
|
kill "$(cat "${pidfile}")" > /dev/null 2>&1
|
||||||
|
cleanup
|
||||||
|
fi
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$pidfile"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_status() {
|
||||||
|
if amixer get Capture | grep -q '\[off\]'; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo " "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
amixer set Capture toggle > /dev/null 2>&1
|
||||||
|
print_status
|
||||||
|
}
|
||||||
|
|
||||||
|
trap "cleanup" EXIT
|
||||||
|
trap "toggle" USR1
|
||||||
|
|
||||||
|
echo $$ > "$pidfile"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
print_status
|
||||||
|
sleep 1 &
|
||||||
|
wait
|
||||||
|
done
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
foreground = ${xrdb:color7:#222222}
|
foreground = ${xrdb:color7:#222222}
|
||||||
background = ${xrdb:color0:#111111}
|
background = #bb111111
|
||||||
|
|
||||||
tray-bg = #222222
|
tray-bg = #222222
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ font-1 = ${env:BAR_ICON_FONT_DECLARATION}
|
||||||
|
|
||||||
modules-left = bspwm
|
modules-left = bspwm
|
||||||
modules-center = date
|
modules-center = date
|
||||||
modules-right = cpu filesystem memory volume xbacklight xkeyboard temperature battery
|
modules-right = cpu filesystem memory volume microphone xbacklight xkeyboard temperature battery
|
||||||
|
|
||||||
tray-position = right
|
tray-position = right
|
||||||
tray-padding = 0
|
tray-padding = 0
|
||||||
|
@ -385,3 +385,11 @@ compositing-border = source
|
||||||
[global/wm]
|
[global/wm]
|
||||||
margin-top = ${env:WINDOW_GAP}
|
margin-top = ${env:WINDOW_GAP}
|
||||||
margin-bottom = ${env:WINDOW_GAP}
|
margin-bottom = ${env:WINDOW_GAP}
|
||||||
|
|
||||||
|
[module/microphone]
|
||||||
|
type = custom/script
|
||||||
|
exec = $DOTFILES_PATH/de/bar/mic.bash
|
||||||
|
tail = true
|
||||||
|
format = <label>
|
||||||
|
label = %output%
|
||||||
|
click-left = kill -USR1 %pid%
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
shadow = true;
|
shadow = true;
|
||||||
no-dnd-shadow = true;
|
|
||||||
no-dock-shadow = true;
|
|
||||||
clearshadow = true;
|
clearshadow = true;
|
||||||
shadow-radius = 20;
|
shadow-radius = 20;
|
||||||
shadow-offset-x = -20;
|
shadow-offset-x = -20;
|
||||||
|
@ -11,7 +9,6 @@ shadow-green = 0.0;
|
||||||
shadow-blue = 0.0;
|
shadow-blue = 0.0;
|
||||||
shadow-ignore-shaped = false;
|
shadow-ignore-shaped = false;
|
||||||
|
|
||||||
menu-opacity = 1.0;
|
|
||||||
inactive-opacity = 1.0;
|
inactive-opacity = 1.0;
|
||||||
active-opacity = 1.0;
|
active-opacity = 1.0;
|
||||||
frame-opacity = 1.0;
|
frame-opacity = 1.0;
|
||||||
|
@ -20,7 +17,6 @@ inactive-opacity-override = false;
|
||||||
fading = true;
|
fading = true;
|
||||||
fade-in-step = 0.06;
|
fade-in-step = 0.06;
|
||||||
fade-out-step = 0.06;
|
fade-out-step = 0.06;
|
||||||
alpha-step = 0.1;
|
|
||||||
inactive-dim = 0.2;
|
inactive-dim = 0.2;
|
||||||
|
|
||||||
focus-exclude = [ "n:e:rofi" ]
|
focus-exclude = [ "n:e:rofi" ]
|
||||||
|
@ -28,19 +24,18 @@ focus-exclude = [ "n:e:rofi" ]
|
||||||
mark-wmwin-focused = true;
|
mark-wmwin-focused = true;
|
||||||
mark-ovredir-focused = false;
|
mark-ovredir-focused = false;
|
||||||
detect-rounded-corners = true;
|
detect-rounded-corners = true;
|
||||||
detect-client-opacity = true;
|
detect-client-opacity = false;
|
||||||
|
|
||||||
vsync = "opengl-swc";
|
vsync = true;
|
||||||
backend = "glx";
|
backend = "glx";
|
||||||
refresh-rate = 0;
|
refresh-rate = 0;
|
||||||
glx-no-stencil = true;
|
glx-no-stencil = true;
|
||||||
glx-no-rebind-pixmap = true;
|
glx-no-rebind-pixmap = true;
|
||||||
glx-copy-from-front = false;
|
glx-copy-from-front = false;
|
||||||
xrender-sync-fence = true;
|
xrender-sync-fence = true;
|
||||||
glx-swap-method = "buffer-age";
|
use-damage = true;
|
||||||
|
|
||||||
dbe = false;
|
dbe = false;
|
||||||
paint-on-overlay = true;
|
|
||||||
detect-transient = true;
|
detect-transient = true;
|
||||||
detect-client-leader = true;
|
detect-client-leader = true;
|
||||||
invert-color-include = [ ];
|
invert-color-include = [ ];
|
||||||
|
@ -50,5 +45,7 @@ blur-background-frame = false;
|
||||||
wintypes :
|
wintypes :
|
||||||
{
|
{
|
||||||
tooltip : { fade = false; shadow = false; opacity = 0.75; };
|
tooltip : { fade = false; shadow = false; opacity = 0.75; };
|
||||||
|
dock : { fade = false; shadow = false; opacity = 1.0; };
|
||||||
|
dnd : { fade = false; shadow = false; opacity = 0.75; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -253,3 +253,6 @@ super + d
|
||||||
|
|
||||||
super + ctrl + c
|
super + ctrl + c
|
||||||
bspc rule -a '*' -o state=floating && urxvtc --geometry 80x16 -e sh -c "khal calendar && bash"
|
bspc rule -a '*' -o state=floating && urxvtc --geometry 80x16 -e sh -c "khal calendar && bash"
|
||||||
|
|
||||||
|
super + shift + v
|
||||||
|
kill -USR1 $(cat "/var/run/user/$UID/polybar-mic-script.pid")
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
URxvt.font: xft:Iosevka:pixelsize=14,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
URxvt.font: xft:Iosevka:pixelsize=14,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
||||||
URxvt.faceName: xft:Iosevka:pixelsize=14,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
URxvt.faceName: xft:Iosevka:pixelsize=14,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
||||||
URxvt.boldFont: xft:Iosevka:pixelsize=14:style=bold,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
URxvt.boldFont: xft:Iosevka:pixelsize=14:style=bold,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14
|
||||||
|
# URxvt.transparent: true
|
||||||
|
# URxvt.shading: 70
|
||||||
URxvt.letterSpace: 0
|
URxvt.letterSpace: 0
|
||||||
|
|
||||||
## rxvt-unicode configuration
|
## rxvt-unicode configuration
|
||||||
|
@ -36,7 +38,6 @@ URxvt.resize-font.smaller: C-Down
|
||||||
URxvt.resize-font.bigger: C-Up
|
URxvt.resize-font.bigger: C-Up
|
||||||
URxvt.url-launcher: /usr/bin/xdg-open
|
URxvt.url-launcher: /usr/bin/xdg-open
|
||||||
URxvt.matcher.button: 1
|
URxvt.matcher.button: 1
|
||||||
URxvt.depth: 0
|
|
||||||
URxvt.iso14755: False
|
URxvt.iso14755: False
|
||||||
|
|
||||||
## Other Xorg configuration
|
## Other Xorg configuration
|
||||||
|
|
|
@ -122,3 +122,5 @@ _make_paths
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
|
|
||||||
|
[[ -s "/home/daniel/usr/.gvm/scripts/gvm" ]] && source "/home/daniel/usr/.gvm/scripts/gvm"
|
||||||
|
|
|
@ -5,7 +5,7 @@ bind-key s send-prefix
|
||||||
|
|
||||||
bind-key T source-file ~/.tmux.conf \; display-message "source-file done"
|
bind-key T source-file ~/.tmux.conf \; display-message "source-file done"
|
||||||
|
|
||||||
# set-option -g mouse on
|
set-option -g mouse on
|
||||||
|
|
||||||
# honestly not sure
|
# honestly not sure
|
||||||
set -g escape-time 10
|
set -g escape-time 10
|
||||||
|
|
Reference in a new issue