feat: work configuration

This commit is contained in:
aduhayon 2022-07-20 09:14:11 +02:00
parent 4fe55fe2e1
commit 4e1425e61d
23 changed files with 1150 additions and 71 deletions

View file

@ -1,2 +1,2 @@
#!/usr/bin/bash
#!/bin/bash
docker run -it --rm -v "$PWD":/tmp epitechcontent/epitest-docker:latest /bin/bash

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
set -e
# counts target = 8182 ~ 25cm

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
set -e
usage() {

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
usage() {
echo "Usage: $0 /dev/pts/{tty_nb}"

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
set -e
CUR_LIGHT="$(set-light "$@")"

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash
set -e
shopt -s extglob nullglob
@ -21,7 +21,7 @@ case "${1:0:1}" in
exit 1
;;
"+"|"-")
NEW="$((CUR + $1))"
NEW="$((CUR + "$1"))"
;;
*)
NEW="$1"

View file

@ -1,21 +1,25 @@
#!/usr/bin/bash
#!/bin/bash
set -e
CUR="$(pactl get-sink-volume 0 | awk '$1 == "Volume:" {print substr($5, 1, length($5) - 1)}')"
SHIFT="${1}"
CUR_FILE=/var/tmp/current_volume
set +e
CUR="$(cat "$CUR_FILE" || echo 50)"
set -e
case "${1:0:1}" in
'')
exit 1
;;
'+'|'-')
NEW="$((CUR - CUR % SHIFT + SHIFT))"
NEW="$((CUR + "$1"))"
;;
*)
NEW="$1"
;;
esac
[ "$NEW" -lt 0 ] && NEW=0
[ "$NEW" -gt 100 ] && NEW=100
pactl set-sink-volume 0 "$NEW"%