my_konfig
This commit is contained in:
65
config/waybar/bluetooth.sh
Executable file
65
config/waybar/bluetooth.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ein einfaches Skript zur Steuerung von Bluetooth über wofi und bluetoothctl
|
||||
|
||||
# Funktion zum Anzeigen des Menüs
|
||||
show_menu() {
|
||||
# Prüfen, ob Bluetooth eingeschaltet ist
|
||||
if /usr/bin/bluetoothctl show | grep -q "Powered: yes"; then
|
||||
power_status="On"
|
||||
power_option=" Turn Off"
|
||||
else
|
||||
power_status="Off"
|
||||
power_option=" Turn On"
|
||||
fi
|
||||
|
||||
# Menüoptionen zusammenstellen
|
||||
options="$power_option\n Scan for devices"
|
||||
|
||||
# Liste der bekannten und gekoppelten Geräte abrufen
|
||||
devices=$(/usr/bin/bluetoothctl devices Paired | awk '{print $3, $4, $5, $6, $7}')
|
||||
if [ -n "$devices" ]; then
|
||||
options+="\n\nPaired Devices:"
|
||||
while read -r line; do
|
||||
mac=$(echo "$line" | awk '{print $1}')
|
||||
name=$(echo "$line" | cut -d' ' -f2-)
|
||||
if /usr/bin/bluetoothctl info "$mac" | grep -q "Connected: yes"; then
|
||||
options+="\n $name (Connected)"
|
||||
else
|
||||
options+="\n $name"
|
||||
fi
|
||||
done <<< "$devices"
|
||||
fi
|
||||
|
||||
# Menü mit wofi anzeigen und Auswahl des Benutzers abrufen
|
||||
chosen=$(echo -e "$options" | wofi --dmenu --prompt "Bluetooth | Status: $power_status")
|
||||
|
||||
# Auswahl verarbeiten
|
||||
case "$chosen" in
|
||||
" Turn Off")
|
||||
/usr/bin/bluetoothctl power off
|
||||
;;
|
||||
" Turn On")
|
||||
/usr/bin/bluetoothctl power on
|
||||
;;
|
||||
" Scan for devices")
|
||||
# Scan im Hintergrund für 10 Sekunden in einem neuen Terminal starten
|
||||
alacritty -e bash -c "echo 'Scanning for 15 seconds...'; /usr/bin/bluetoothctl scan on; sleep 15; /usr/bin/bluetoothctl scan off; echo 'Scan finished.'; sleep 2" &
|
||||
;;
|
||||
*)
|
||||
# Wenn ein Gerät ausgewählt wurde
|
||||
if [[ "$chosen" == *"Connected"* ]]; then
|
||||
mac=$(/usr/bin/bluetoothctl devices Paired | grep "$(echo "$chosen" | sed 's/ (Connected)//' | sed 's/ //')" | awk '{print $2}')
|
||||
/usr/bin/bluetoothctl disconnect "$mac"
|
||||
elif [[ "$chosen" == *"Paired Devices:"* ]] || [[ "$chosen" == "" ]]; then
|
||||
# Mache nichts, wenn der Header oder nichts ausgewählt wurde
|
||||
:
|
||||
else
|
||||
mac=$(/usr/bin/bluetoothctl devices Paired | grep "$(echo "$chosen" | sed 's/ //')" | awk '{print $2}')
|
||||
/usr/bin/bluetoothctl connect "$mac"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_menu
|
||||
101
config/waybar/config
Normal file
101
config/waybar/config
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"height": 35,
|
||||
"modules-left": ["sway/workspaces", "sway/mode"],
|
||||
"modules-center": ["clock"],
|
||||
"modules-right": ["mpris", "tray", "pulseaudio", "custom/bluetooth", "network", "cpu", "memory", "sway/window", "idle_inhibitor", "custom/power"],
|
||||
|
||||
"mpris": {
|
||||
"format": "{player_icon} {dynamic}",
|
||||
"format-paused": "{player_icon} {dynamic}",
|
||||
"player-icons": {
|
||||
"default": "🎵",
|
||||
"kew": "🎧"
|
||||
},
|
||||
"tooltip-format": "Titel: {title}\nAlbum: {album}\nKünstler: {artist}",
|
||||
"max-length": 30,
|
||||
"on-click": "playerctl play-pause",
|
||||
"on-scroll-up": "playerctl next",
|
||||
"on-scroll-down": "playerctl previous"
|
||||
},
|
||||
|
||||
"tray": {
|
||||
"icon-size": 16,
|
||||
"spacing": 10
|
||||
},
|
||||
|
||||
"custom/power": {
|
||||
"format": "",
|
||||
"tooltip": false,
|
||||
"on-click": "~/.config/waybar/power.sh"
|
||||
},
|
||||
|
||||
"custom/bluetooth": {
|
||||
"format": " {}",
|
||||
"exec": "/usr/bin/bluetoothctl show | grep -q 'Powered: yes' && echo 'On' || echo 'Off'",
|
||||
"tooltip": true,
|
||||
"interval": 15,
|
||||
"on-click": "~/.config/waybar/bluetooth.sh"
|
||||
},
|
||||
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"format": "{name}"
|
||||
},
|
||||
"sway/mode": {
|
||||
"format": "<span style='italic'>{}</span>"
|
||||
},
|
||||
"sway/window": {
|
||||
"format": "{}",
|
||||
"max-length": 50
|
||||
},
|
||||
"clock": {
|
||||
"format": " {:%H:%M:%S}",
|
||||
"interval": 1,
|
||||
"format-alt": " {:%d.%m.%Y}",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage}%",
|
||||
"tooltip": true,
|
||||
"interval": 1
|
||||
},
|
||||
"memory": {
|
||||
"format": " {}%",
|
||||
"interval": 1
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": " {essid}",
|
||||
"format-ethernet": " {ifname}",
|
||||
"format-linked": " {ifname} (No IP)",
|
||||
"format-disconnected": "⚠",
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"on-click": "alacritty -e iwctl"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}%",
|
||||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", ""]
|
||||
},
|
||||
"on-click": "pavucontrol",
|
||||
"on-click-right": "pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
||||
},
|
||||
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
},
|
||||
"tooltip": "Bildschirmsperre verhindern"
|
||||
}
|
||||
}
|
||||
17
config/waybar/power.sh
Executable file
17
config/waybar/power.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
entries="Ausloggen
|
||||
Neustart
|
||||
Herunterfahren"
|
||||
selected=$(echo -e $entries | wofi --show dmenu --prompt "Power-Menü")
|
||||
|
||||
case $selected in
|
||||
"Ausloggen")
|
||||
swaymsg exit
|
||||
;;
|
||||
"Neustart")
|
||||
systemctl reboot
|
||||
;;
|
||||
"Herunterfahren")
|
||||
systemctl poweroff
|
||||
;;
|
||||
esac
|
||||
118
config/waybar/style.css
Normal file
118
config/waybar/style.css
Normal file
@@ -0,0 +1,118 @@
|
||||
/* Catppuccin-Mocha Waybar Theme (Kompatibilitätsversion) */
|
||||
|
||||
* {
|
||||
border: none;
|
||||
font-family: "DejaVu Sans Mono", "Font Awesome 7 Free Solid", "Font Awesome 7 Brands", "Font Awesome 7 Free";
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(30, 30, 46, 0.85); /* Base with transparency */
|
||||
color: #cdd6f4; /* Text */
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
border-radius: 15px;
|
||||
margin: 5px 5px;
|
||||
}
|
||||
|
||||
#workspaces,
|
||||
#mode,
|
||||
#clock,
|
||||
#cpu,
|
||||
#memory,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-bluetooth,
|
||||
#custom-power,
|
||||
#window,
|
||||
#mpris {
|
||||
padding: 2px 10px;
|
||||
margin: 3px 3px;
|
||||
border-radius: 10px;
|
||||
transition: background-color 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #a6adc8; /* Subtext0 */
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #313244; /* Surface0 */
|
||||
color: #cdd6f4; /* Text */
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #f38ba8; /* Red */
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #cba6f7; /* Mauve */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#custom-bluetooth, #custom-power {
|
||||
background-color: #74c7ec; /* Sapphire */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: #94e2d5; /* Teal */
|
||||
color: #1e1e2e; /* Base */
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background-color: #a6e3a1; /* Green */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#memory {
|
||||
background-color: #89b4fa; /* Blue */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#network {
|
||||
background-color: #f9e2af; /* Yellow */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: #f5c2e7; /* Pink */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#mpris {
|
||||
background-color: #b4befe; /* Lavender */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#window {
|
||||
font-weight: bold;
|
||||
color: #cdd6f4; /* Text */
|
||||
}
|
||||
|
||||
/* Hover-Effekt für alle Module */
|
||||
#workspaces:hover, #mode:hover, #clock:hover, #cpu:hover, #memory:hover, #network:hover, #pulseaudio:hover, #custom-bluetooth:hover, #custom-power:hover {
|
||||
background-color: rgba(88, 91, 112, 0.9); /* Surface2 with transparency */
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
padding: 2px 10px;
|
||||
margin: 3px 3px;
|
||||
border-radius: 10px;
|
||||
background-color: #f38ba8; /* Red */
|
||||
color: #1e1e2e; /* Base */
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
background-color: #a6e3a1; /* Green */
|
||||
}
|
||||
Reference in New Issue
Block a user