From 09a818598a8b5c63a5a4e7506bd58cf5569514c7 Mon Sep 17 00:00:00 2001 From: sevi-kun Date: Tue, 26 May 2020 08:31:18 +0200 Subject: [PATCH] add *.sh --- dec_brightness.sh | 4 ++++ dec_vol.sh | 5 +++++ inc_brightness.sh | 4 ++++ inc_vol.sh | 5 +++++ passmenu.sh | 25 +++++++++++++++++++++++++ settings_manager.sh | 0 toggle_bluetooth.sh | 8 ++++++++ toggle_mic.sh | 9 +++++++++ toggle_mute.sh | 9 +++++++++ toggle_wifi.sh | 11 +++++++++++ 10 files changed, 80 insertions(+) create mode 100755 dec_brightness.sh create mode 100755 dec_vol.sh create mode 100755 inc_brightness.sh create mode 100755 inc_vol.sh create mode 100755 passmenu.sh create mode 100755 settings_manager.sh create mode 100755 toggle_bluetooth.sh create mode 100755 toggle_mic.sh create mode 100755 toggle_mute.sh create mode 100755 toggle_wifi.sh diff --git a/dec_brightness.sh b/dec_brightness.sh new file mode 100755 index 0000000..22c343b --- /dev/null +++ b/dec_brightness.sh @@ -0,0 +1,4 @@ +#!/bin/bash +brightnessctl -q set 5%- +msg="Helligkeit: $(echo $(($(brightnessctl get)/12)))%" +notify-send --expire-time=500 "$msg" diff --git a/dec_vol.sh b/dec_vol.sh new file mode 100755 index 0000000..fc08eb5 --- /dev/null +++ b/dec_vol.sh @@ -0,0 +1,5 @@ +#!/bin/bash +pulsemixer --change-volume -5 +vol="$(amixer -D pulse get Master | awk -F'[][]' 'END{ print $2 }')" +notify-send --expire-time=500 "Volume $vol" + diff --git a/inc_brightness.sh b/inc_brightness.sh new file mode 100755 index 0000000..41d2167 --- /dev/null +++ b/inc_brightness.sh @@ -0,0 +1,4 @@ +#!/bin/bash +brightnessctl -q set +5% +msg="Helligkeit: $(echo $(($(brightnessctl get)/12)))%" +notify-send --expire-time=500 "$msg" diff --git a/inc_vol.sh b/inc_vol.sh new file mode 100755 index 0000000..e9fcc7d --- /dev/null +++ b/inc_vol.sh @@ -0,0 +1,5 @@ +#!/bin/bash +pulsemixer --change-volume +5 +vol="$(amixer -D pulse get Master | awk -F'[][]' 'END{ print $2 }')" +notify-send --expire-time=500 "Volume $vol" + diff --git a/passmenu.sh b/passmenu.sh new file mode 100755 index 0000000..83268bc --- /dev/null +++ b/passmenu.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + +password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | + xdotool type --clearmodifiers --file - +fi diff --git a/settings_manager.sh b/settings_manager.sh new file mode 100755 index 0000000..e69de29 diff --git a/toggle_bluetooth.sh b/toggle_bluetooth.sh new file mode 100755 index 0000000..0560e8d --- /dev/null +++ b/toggle_bluetooth.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if rfkill list bluetooth | grep -q 'yes$' ; then + rfkill unblock bluetooth + notify-send "Bloetooth is now enabled" +else + rfkill block bluetooth + notify-send "Bloetooth is now disabled" +fi diff --git a/toggle_mic.sh b/toggle_mic.sh new file mode 100755 index 0000000..7187c95 --- /dev/null +++ b/toggle_mic.sh @@ -0,0 +1,9 @@ +#!/bin/bash +pulsemixer --id source-1 --toggle-mute +mic_state=$(pulsemixer --id source-1 --get-mute) +if [ "$mic_state" == "0" ] +then + notify-send "Mic is now unmuted" +else + notify-send "Mic is now muted" +fi diff --git a/toggle_mute.sh b/toggle_mute.sh new file mode 100755 index 0000000..869f1bb --- /dev/null +++ b/toggle_mute.sh @@ -0,0 +1,9 @@ +#!/bin/bash +pulsemixer --toggle-mute +muted=$(amixer -D pulse get Master | awk -F'[][]' 'END{ print $4}') +if [ "on" == "$muted" ] +then + notify-send "Sound is now toggled on" +else + notify-send "Sound is now toggled off" +fi diff --git a/toggle_wifi.sh b/toggle_wifi.sh new file mode 100755 index 0000000..865728f --- /dev/null +++ b/toggle_wifi.sh @@ -0,0 +1,11 @@ +#!/bin/bash +wifi_block=$(rfkill list wifi | grep Soft | awk '{print $3}') +if [ "$wifi_block" == "yes" ] +then + rfkill unblock wifi + notify-send "Wifi is now enabled" +else + rfkill block wifi + notify-send "Wifi is now disabled" +fi +sleep 0.2