feat: Test ironbar

This commit is contained in:
Fabio Lenherr / DashieTM 2023-08-25 18:11:05 +02:00
parent e147a91d84
commit 993bd794f0
17 changed files with 825 additions and 116 deletions

View file

@ -0,0 +1,85 @@
#!/bin/bash
ncspot() {
echo "$1"
echo "$2"
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
dunstify -a "ncspot" -r 990 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Spotify Volume: ${VOLUME}%"
}
firefox() {
STRING=$(pactl list clients short | rg "firefox" | awk -F 'PipeWire' ' { print $1 "," } ' | tr -d ' \t\n')
# NUMS=',' read -r -a array <<< "$STRING"
readarray -td, NUMS <<<"$STRING"
declare -p NUMS
for index in "${!NUMS[@]}"; do #"${!array[@]}"
NUM=$(echo "${NUMS[index]}" | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
done
VOLUME=$(pactl list sink-inputs | rg "${NUMS[0]}" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
dunstify -a "Firefox" -r 991 -u low -i audio-volume-high -h int:progress:"$VOLUME" "Firefox Volume: ${VOLUME}%"
}
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
# dunstify -a "changeVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Output Volume: ${CURRENT}%"
dunstify -a "System Volume" -r 993 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Output Volume: ${CURRENT}%"
}
set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
# dunstify -a "changeMicVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Input Volume: ${CURRENT}%"
dunstify -a "System Volume" -r 993 -u low -i audio-volume-high -h int:progress:"$CURRENT" "Input Volume: ${CURRENT}%"
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
mute() {
pactl set-sink-mute @DEFAULT_SINK@ toggle
MUTE=$(pactl get-sink-mute @DEFAULT_SINK@)
dunstify -a "Audio" -r 994 -u low -i audio-volume-high "Audio: $MUTE"
}
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
elif [ "$1" == "firefox" ]; then
firefox "$2"
elif [ "$1" == "ncspot" ]; then
ncspot "$2"
elif [ "$1" == "mute" ]; then
mute
elif [ "$1" == "sink" ]; then
set_volume_sink "$2"
elif [ "$1" == "source" ]; then
set_volume_source "$2"
fi

View file

@ -1,37 +0,0 @@
#! /bin/bash
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$( echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
else
SPEAKER=$(pactl info | grep "Default Sink" | awk -F ': ' ' { print $2 } ')
pactl set-sink-mute "$SPEAKER" false
fi

View file

@ -1,20 +0,0 @@
#! /bin/bash
set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
dunstify -a "changeVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Output Volume: ${CURRENT}%"
}
set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
dunstify -a "changeMicVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Input Volume: ${CURRENT}%"
}
if [ "$1" == "sink" ]; then
set_volume_sink "$2"
elif [ "$1" == "source" ]; then
set_volume_source "$2"
fi

View file

@ -1,5 +0,0 @@
#! /bin/bash
NUM=$(pactl list clients short | grep "firefox" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CLIENT=$(pactl list sink-inputs short | grep "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CLIENT" "$1"

View file

@ -1,7 +0,0 @@
#! /bin/bash
NUM=$(pactl list clients short | rg "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CHANGE=$(pactl list sink-inputs short | rg "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CHANGE" "$1"
VOLUME=$(pactl list sink-inputs | rg "$NUM" -A7 | rg "Volume:" | awk -F ' ' ' { print $5 }' | tr -d '%')
dunstify -a "changeVolume" -r 2 -u low -i audio-volume-high -h int:value:"$VOLUME" "Spotify Volume: ${VOLUME}%"

9
eww_desktop/scripts/oxidash.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
ID=$(pgrep oxidash-gtk)
if [ "$ID" != "" ]; then
killall oxidash-gtk
else
oxidash-gtk
fi

View file

@ -25,16 +25,16 @@ o9=$(hyprctl workspaces | grep "$ws9" )
o0=$(hyprctl workspaces | grep "$ws0" )
# check if Focused
f1=$(hyprctl monitors | grep "workspace: 1 " -A 4 | grep "focused: yes" )
f2=$(hyprctl monitors | grep "workspace: 2 " -A 4 | grep "focused: yes" )
f3=$(hyprctl monitors | grep "workspace: 3 " -A 4 | grep "focused: yes" )
f4=$(hyprctl monitors | grep "workspace: 4 " -A 4 | grep "focused: yes" )
f5=$(hyprctl monitors | grep "workspace: 5 " -A 4 | grep "focused: yes" )
f6=$(hyprctl monitors | grep "workspace: 6 " -A 4 | grep "focused: yes" )
f7=$(hyprctl monitors | grep "workspace: 7 " -A 4 | grep "focused: yes" )
f8=$(hyprctl monitors | grep "workspace: 8 " -A 4 | grep "focused: yes" )
f9=$(hyprctl monitors | grep "workspace: 9 " -A 4 | grep "focused: yes" )
f0=$(hyprctl monitors | grep "workspace: 10" -A 4 | grep "focused: yes" )
f1=$(hyprctl monitors | grep "workspace: 1 " -A 5 | grep "focused: yes" )
f2=$(hyprctl monitors | grep "workspace: 2 " -A 5 | grep "focused: yes" )
f3=$(hyprctl monitors | grep "workspace: 3 " -A 5 | grep "focused: yes" )
f4=$(hyprctl monitors | grep "workspace: 4 " -A 5 | grep "focused: yes" )
f5=$(hyprctl monitors | grep "workspace: 5 " -A 5 | grep "focused: yes" )
f6=$(hyprctl monitors | grep "workspace: 6 " -A 5 | grep "focused: yes" )
f7=$(hyprctl monitors | grep "workspace: 7 " -A 5 | grep "focused: yes" )
f8=$(hyprctl monitors | grep "workspace: 8 " -A 5 | grep "focused: yes" )
f9=$(hyprctl monitors | grep "workspace: 9 " -A 5 | grep "focused: yes" )
f0=$(hyprctl monitors | grep "workspace: 10" -A 5 | grep "focused: yes" )
if [ "$o1" != "" ]; then
ic_1="①"