mirror of
https://github.com/bvanroll/_dotfiles.git
synced 2025-08-29 20:12:42 +00:00
init
This commit is contained in:
30
.config/i3blocks/miccontrol/README.md
Normal file
30
.config/i3blocks/miccontrol/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# miccontrol
|
||||
|
||||
Shows the status of you microphone. Left and right click toggles mute.
|
||||
|
||||
 
|
||||
|
||||
# Usage
|
||||
|
||||
This block can be run on an interval or by signal. To run the block using a
|
||||
signal, it is recommended to add the following to your i3 config.
|
||||
|
||||
```
|
||||
# toggle mute
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute "alsa_input.pci-0000_00_1f.3.analog-stereo" toggle && pkill -RTMIN+10 i3blocks
|
||||
```
|
||||
where the `alsa_input.pci-0000_00_1f.3.analog-stereo` after `set-source-mute` can be changed to another source name
|
||||
and `10` in `-RTMIN+10` can be replaced to another signal number,
|
||||
as long as it agrees what you put for `signal=` in your i3blocks config.
|
||||
|
||||
# Config
|
||||
|
||||
```
|
||||
[miccontrol]
|
||||
command=$SCRIPT_DIR/miccontrol
|
||||
#label=MIC
|
||||
SOURCE=alsa_input.pci-0000_00_1f.3.analog-stereo
|
||||
interval=10
|
||||
signal=10
|
||||
```
|
||||
|
6
.config/i3blocks/miccontrol/i3blocks.conf
Normal file
6
.config/i3blocks/miccontrol/i3blocks.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
[miccontrol]
|
||||
command=$SCRIPT_DIR/miccontrol
|
||||
#label=MIC
|
||||
SOURCE=alsa_input.pci-0000_00_1f.3.analog-stereo
|
||||
interval=10
|
||||
signal=10
|
29
.config/i3blocks/miccontrol/miccontrol
Executable file
29
.config/i3blocks/miccontrol/miccontrol
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2020 Filip Paskali
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1|3) pactl set-source-mute $SOURCE toggle ;;
|
||||
esac
|
||||
|
||||
case $(pacmd list-sources | grep -A 11 "$SOURCE" | awk '/muted/ {print $2; exit}') in
|
||||
yes)
|
||||
echo ""
|
||||
;;
|
||||
no)
|
||||
echo ""
|
||||
;;
|
||||
esac
|
BIN
.config/i3blocks/miccontrol/screenshot1.png
Normal file
BIN
.config/i3blocks/miccontrol/screenshot1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
.config/i3blocks/miccontrol/screenshot2.png
Normal file
BIN
.config/i3blocks/miccontrol/screenshot2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user