fix: audio control and implement switch to bluettooth and internal
This commit is contained in:
parent
07b5b7dc15
commit
db2c08d240
4 changed files with 71 additions and 14 deletions
20
eww/eww.scss
20
eww/eww.scss
|
|
@ -101,10 +101,13 @@ tooltip label {
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconmem {
|
.iconmem {
|
||||||
font-size: 15;
|
font-size: 23;
|
||||||
margin: 11px;
|
margin: 4px -3px 4px 0px;
|
||||||
color: #e0b089;
|
color: #e0b089;
|
||||||
}
|
}
|
||||||
|
.mem_padding {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
.iconbat {
|
.iconbat {
|
||||||
font-size: 23;
|
font-size: 23;
|
||||||
color: #afbea2;
|
color: #afbea2;
|
||||||
|
|
@ -121,7 +124,7 @@ tooltip label {
|
||||||
.mem_module {
|
.mem_module {
|
||||||
background-color: #0f0f17;
|
background-color: #0f0f17;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
margin: 0px 10px 0px 3px;
|
margin: 0px 10px 0px 0px;
|
||||||
}
|
}
|
||||||
.bat_module {
|
.bat_module {
|
||||||
background-color: #0f0f17;
|
background-color: #0f0f17;
|
||||||
|
|
@ -392,6 +395,17 @@ color: #bfc9db;
|
||||||
margin: 20px 0px 0px 0px;
|
margin: 20px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.change_audio_box {
|
||||||
|
margin: 0px 0px 0px 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change_audio {
|
||||||
|
color: #a1bdce;
|
||||||
|
margin: 0px 30px 5px 0px;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.speaker_bar scale trough highlight {
|
.speaker_bar scale trough highlight {
|
||||||
all: unset;
|
all: unset;
|
||||||
background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50);
|
background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50);
|
||||||
|
|
|
||||||
20
eww/eww.yuck
20
eww/eww.yuck
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
;; volume definitions ;;
|
;; volume definitions ;;
|
||||||
(defpoll volume_percent :interval "3s" "pactl get-sink-volume @DEFAULT_SINK@ | awk -F '/' ' { print $2 } ' | tr -d ' %'")
|
(defpoll volume_percent :interval "3s" "pactl get-sink-volume @DEFAULT_SINK@ | awk -F '/' ' { print $2 } ' | tr -d ' %'")
|
||||||
(defpoll mic_percent :interval "3s" "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'")
|
(defpoll mic_percent :interval "3s" "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'")
|
||||||
(defpoll brightness_percent :interval "5s" "brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
|
(defpoll brightness_percent :interval "5s" "brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
|
||||||
|
|
||||||
;; battery definitions ;;
|
;; battery definitions ;;
|
||||||
|
|
@ -88,15 +88,16 @@
|
||||||
;; memory ;;
|
;; memory ;;
|
||||||
(defwidget mem []
|
(defwidget mem []
|
||||||
(box :class "mem_module" :vexpand "false" :hexpand "false"
|
(box :class "mem_module" :vexpand "false" :hexpand "false"
|
||||||
|
(button :class "iconmem"
|
||||||
|
:onclick "$HOME/.config/eww/scripts/pop system"
|
||||||
(circular-progress :value memory
|
(circular-progress :value memory
|
||||||
:class "membar"
|
:class "membar"
|
||||||
:thickness 4
|
:thickness 4
|
||||||
:tooltip "using ${memory}% ram"
|
:tooltip "using ${memory}% ram"
|
||||||
:onclick "$HOME/.config/eww/scripts/pop system"
|
|
||||||
:show_truncated false
|
:show_truncated false
|
||||||
:wrap false
|
:wrap false
|
||||||
(button :class "iconmem" "")
|
(label :class "mem_padding" :text "")
|
||||||
)))
|
))))
|
||||||
|
|
||||||
|
|
||||||
;; seperator ;;
|
;; seperator ;;
|
||||||
|
|
@ -180,9 +181,16 @@
|
||||||
:space-evenly "false"
|
:space-evenly "false"
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:tooltip "mic on ${mic_percent}%"
|
:tooltip "mic on ${mic_percent}%"
|
||||||
:onchange "amixer -D pulse sset Capture {}%"
|
:onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%"
|
||||||
:max 100
|
:max 100
|
||||||
:min 0)))))))
|
:min 0))))
|
||||||
|
(label :text "" :class "audio_sep" :halign "center")
|
||||||
|
(box :class "change_audio_box" :halign "v" :space-evenly "false" :hexpand "false" :vexpand "false"
|
||||||
|
(box :class "change_audio" :orientation "v"
|
||||||
|
(button :onclick "scripts/change-audio internal" ""))
|
||||||
|
(box :class "change_audio" :orientation "v"
|
||||||
|
(button :onclick "scripts/change-audio bluetooth" ""))
|
||||||
|
))))
|
||||||
|
|
||||||
;; Music ;;
|
;; Music ;;
|
||||||
;;(defwidget music []
|
;;(defwidget music []
|
||||||
|
|
|
||||||
37
eww/scripts/change-audio
Executable file
37
eww/scripts/change-audio
Executable file
|
|
@ -0,0 +1,37 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,7 +84,6 @@ fi
|
||||||
hoverGet() {
|
hoverGet() {
|
||||||
NAME="$1"
|
NAME="$1"
|
||||||
EWW_BIN="$HOME/.local/bin/eww"
|
EWW_BIN="$HOME/.local/bin/eww"
|
||||||
STORE="$HOME/.cache/cache.txt"
|
|
||||||
if [[ -f "$STORE" ]]; then
|
if [[ -f "$STORE" ]]; then
|
||||||
rm "$STORE"
|
rm "$STORE"
|
||||||
${EWW_BIN} -c $HOME/.config/eww close "$NAME"
|
${EWW_BIN} -c $HOME/.config/eww close "$NAME"
|
||||||
|
|
@ -92,14 +91,13 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverCreate() {
|
hoverCreate() {
|
||||||
STORE="$HOME/.cache/cache.txt"
|
|
||||||
if [[ ! -f "$STORE" ]]; then
|
if [[ ! -f "$STORE" ]]; then
|
||||||
touch "$STORE"
|
touch "$STORE"
|
||||||
else
|
else
|
||||||
echo "failure!"
|
echo "failure!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
STORE=true
|
||||||
if [ "$1" = "calendar" ]; then
|
if [ "$1" = "calendar" ]; then
|
||||||
calendar
|
calendar
|
||||||
elif [ "$1" = "system" ]; then
|
elif [ "$1" = "system" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue