volumectl/README.md

93 lines
3.3 KiB
Markdown
Raw Normal View History

2020-10-28 14:34:48 +01:00
# Volumectl
2021-09-19 15:10:39 +02:00
A small script that bundles volume control and dunst notification. Intended to be used either on command line or for keyboard shortcuts.
2021-09-19 17:01:06 +02:00
Here below is a demonstration of how it works when pressing the volume and mute
keys. The behaviour of the notification is the same if the script was executed
from the terminal.
2021-09-19 16:30:00 +02:00
![demo](./volumectl_demo.gif)
2021-09-19 15:10:39 +02:00
## Installation
### Dependencies
#### Dunst
2021-09-19 15:11:28 +02:00
Before installing and using this script, you will need to install the official
[dunst](https://wiki.archlinux.org/title/Dunst) package.
2021-09-19 15:10:39 +02:00
Make sure you have the `dunstify` command available, that's what is needed to
have a nice looking percentage bar.
#### Bash Ini Reader
In order to use a custom config file (which is optional, the script works
2021-09-19 15:36:53 +02:00
without it but it's useful if you want to customise it), you need to install the
[read_ini.sh](https://raw.githubusercontent.com/rudimeier/bash_ini_parser/master/read_ini.sh)
2021-09-19 15:37:21 +02:00
script from the [bash_ini_parser](https://github.com/rudimeier/bash_ini_parser)
2021-09-19 15:36:53 +02:00
github repo.
2021-09-19 15:10:39 +02:00
2021-09-19 15:35:26 +02:00
You can do it in two different ways downloading the script directly or cloning
the git repo (the script won't care which one you choose, it knows how to handle
both situations).
2021-09-19 15:10:39 +02:00
2021-09-19 16:07:48 +02:00
##### Option 1: Cloning the git repo
2021-09-19 15:35:26 +02:00
```bash
git clone https://github.com/rudimeier/bash_ini_parser $HOME/.local/lib/bash_ini_parser
```
2021-09-19 16:07:48 +02:00
##### Option 2: Downloading the script directly
2021-09-19 16:14:08 +02:00
Make sure you have `wget` installed first.
Downloading the script directly doesn't change much to do it this way since the
repo hasn't been updated in a while.
2021-09-19 15:38:47 +02:00
2021-09-19 15:10:39 +02:00
```bash
mkdir -p $HOME/.local/lib
wget -O $HOME/.local/lib/read_ini.sh https://raw.githubusercontent.com/rudimeier/bash_ini_parser/master/read_ini.sh
chmod +x $HOME/.local/lib/read_ini.sh
```
2021-09-19 15:35:26 +02:00
### Installing volumectl
2021-09-19 16:07:48 +02:00
To install this script, you can do it in a similar way as with the ini parser, you
can either clone the repo or download the script directly (this option is not recommended
because you might miss new features or bug fixes).
#### Option 1 (recommended): Cloning the repo
To make install the script, just clone this repo and then create a symlink to
`volumectl` in whatever directory you want (as long as it is in your `$PATH`
variable, so that the script will be executable from anywhere in the terminal,
see this [link](https://www.tecmint.com/set-path-variable-linux-permanently/)
2021-09-19 16:13:07 +02:00
for more info about the `$PATH` variable). In the commands below I'm using the
`$HOME/.local/bin`, which by default is **not** in the `$PATH` variable, so make
sure you set it.
2021-09-19 16:07:48 +02:00
```bash
git clone https://github.com/karma-riuk/volumectl $HOME/.local/lib/volumectl
mkdir -p $HOME/.local/bin # just to make sure that the ~/.local/bin directory exists
ln -s $HOME/.local/lib/volumectl $HOME/.local/bin/volumectl
```
2021-09-19 16:13:07 +02:00
#### Option 2 (not recommended): Downloading the script directly
```bash
mkdir -p $HOME/.local/bin
wget -O $HOME/.local/bin/volumectl https://raw.githubusercontent.com/karma-riuk/volumectl/master/volumectl
chmod +x $HOME/.local/bin/volumectl
```
2021-09-19 17:01:06 +02:00
## Usage
To use the script, simply execute the `volumectl` with the flag you want,
example:
```bash
volumectl -i
```
### Possible flags
(You can find all the information below by doing `volumectl -h`)
|Flag|Usage|
|----|-----|
2021-09-19 17:02:33 +02:00
|`-i` <br> `--increase` <br>`-i arg` <br>`--increase arg` | increases the volume by the "normal" amount (5%) or by the `arg` amount |
2021-09-19 16:07:48 +02:00