add script for changing volume and displaying notification
This commit is contained in:
parent
7f859fa821
commit
a764425702
|
@ -0,0 +1,33 @@
|
||||||
|
# script that changes the volume and then shows a notfication with it using dunst
|
||||||
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
def get_amixer_volume() -> int:
|
||||||
|
s: str = str(subprocess.check_output(["amixer", "get", "Master"]))
|
||||||
|
try:
|
||||||
|
# turns the front left argument into an int
|
||||||
|
return int(
|
||||||
|
# the thing we're looking for is in the fifth line
|
||||||
|
s.split(r"\n")[5]
|
||||||
|
.strip()
|
||||||
|
# and is the 4th word
|
||||||
|
.split(" ")[4]
|
||||||
|
.replace("[", "")
|
||||||
|
.replace("]", "")
|
||||||
|
.replace("%", "")
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
return -1
|
||||||
|
|
||||||
|
|
||||||
|
def display_volume(volume: int):
|
||||||
|
subprocess.call(
|
||||||
|
["dunstify", "volume 蓼", "-h", "int:value:" + str(volume), "-r", "39489384"]
|
||||||
|
)
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("volchange")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
subprocess.check_output(["amixer", "set", "Master", args.volchange])
|
||||||
|
display_volume(get_amixer_volume())
|
|
@ -14,12 +14,21 @@ pkgs:
|
||||||
'';
|
'';
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# coc
|
# autocompletion
|
||||||
coc-nvim
|
coc-nvim
|
||||||
|
|
||||||
|
# rust
|
||||||
coc-rust-analyzer
|
coc-rust-analyzer
|
||||||
coc-lua
|
|
||||||
|
# python
|
||||||
|
coc-pyright
|
||||||
|
|
||||||
|
# nix
|
||||||
vim-nix
|
vim-nix
|
||||||
|
|
||||||
|
# lua
|
||||||
|
coc-lua
|
||||||
|
|
||||||
# make brackets nicer
|
# make brackets nicer
|
||||||
nvim-autopairs
|
nvim-autopairs
|
||||||
|
|
||||||
|
|
12
user.nix
12
user.nix
|
@ -25,14 +25,6 @@
|
||||||
# music / sound
|
# music / sound
|
||||||
cmus
|
cmus
|
||||||
pavucontrol
|
pavucontrol
|
||||||
## production
|
|
||||||
### daw
|
|
||||||
lmms
|
|
||||||
### plugin
|
|
||||||
surge-XT
|
|
||||||
zynaddsubfx
|
|
||||||
fluidsynth
|
|
||||||
carla
|
|
||||||
|
|
||||||
# video
|
# video
|
||||||
mpv
|
mpv
|
||||||
|
@ -64,10 +56,6 @@
|
||||||
## python
|
## python
|
||||||
python311
|
python311
|
||||||
black
|
black
|
||||||
## haskell
|
|
||||||
stylish-haskell
|
|
||||||
haskell-language-server
|
|
||||||
ghc
|
|
||||||
|
|
||||||
# help
|
# help
|
||||||
tldr
|
tldr
|
||||||
|
|
Loading…
Reference in New Issue