aboutsummaryrefslogtreecommitdiff
path: root/home-manager/homeModules/attachments/hypr-scripts/switch_sink.py
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2025-04-15 22:44:04 +0300
committerspl3g <spleefer6@yandex.ru>2025-05-01 14:59:18 +0300
commitba1f63c6c5137dc9a7c8550ff2f1f052377a0091 (patch)
treeeee3c5159119b8359d03cd97a1bd8b7a41dec13e /home-manager/homeModules/attachments/hypr-scripts/switch_sink.py
parent841ee4137d95f7ed5aafd7f8e29c94e12e712665 (diff)
feat(hyprland): cleanup scripts
Diffstat (limited to 'home-manager/homeModules/attachments/hypr-scripts/switch_sink.py')
-rwxr-xr-xhome-manager/homeModules/attachments/hypr-scripts/switch_sink.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/home-manager/homeModules/attachments/hypr-scripts/switch_sink.py b/home-manager/homeModules/attachments/hypr-scripts/switch_sink.py
deleted file mode 100755
index ff554ae..0000000
--- a/home-manager/homeModules/attachments/hypr-scripts/switch_sink.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python3
-
-import subprocess
-
-status = subprocess.run(["wpctl", "status"], stdout=subprocess.PIPE).stdout.decode('utf-8')
-status_lines = status.split('\n')
-sink_line = 0
-selected_sink = 0
-sinks = []
-sink_names = []
-
-# Get sink line
-for i in range(len(status_lines) - 1):
- if 'Sinks:' in status_lines[i]:
- sink_line = i + 1
- break
-
-# Find unused sinks
-for line in status_lines[sink_line:]:
- if line == ' │ ':
- break
- line = line.split('.')
- nums = line[0]
- name = line[1]
- end_name = line[1].index('[')
- sink = nums[8:]
- if nums[4] == '*':
- selected_sink = sink
-
- sinks.append(sink)
- sink_names.append(name[:end_name].strip())
-
-next_sink = sinks.index(selected_sink) + 1
-if next_sink == len(sinks):
- next_sink = 0
-
-next_sink_name = sink_names[next_sink]
-subprocess.run(["wpctl", "set-default", sinks[next_sink]])
-
-subprocess.run(["notify-send", "Pipewire sink", "Selected " + next_sink_name])
-