From 55be7db85fc33cb3980befe52adf83be35913b04 Mon Sep 17 00:00:00 2001 From: Roland Thomas Date: Thu, 29 Jun 2023 14:14:27 -0400 Subject: [PATCH] Add set_audio_sink, weather, grade --- .config/qtile/config.py | 2 ++ .local/bin/grade | 6 ++++++ .local/bin/set_audio_sink | 19 +++++++++++++++++++ .local/bin/weather | 3 +++ 4 files changed, 30 insertions(+) create mode 100755 .local/bin/grade create mode 100755 .local/bin/set_audio_sink create mode 100755 .local/bin/weather diff --git a/.config/qtile/config.py b/.config/qtile/config.py index cbf8ff4..3dc1e20 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -22,6 +22,7 @@ python = f'alacritty {opaque_config} -e python' vpn_vta = 'alacritty -e /home/roland/.local/bin/vpn' bjendal = 'alacritty -e /home/roland/.local/bin/bjendal' lumar = 'alacritty -e /home/roland/.local/bin/lumar' +set_audio_sink = '/home/roland/.local/bin/set_audio_sink' cmatrix = 'alacritty -e cmatrix' rofi = 'rofi -combi-modi window,drun,ssh -theme nord -font "hack 12" -show drun -icon-theme "Papirus" -show-icons' qtile_dir = '/home/roland/.config/qtile/' @@ -156,6 +157,7 @@ keys = [ Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), + Key([mod, "control"], "s", lazy.spawn(set_audio_sink), desc="Reset Audio Sink"), Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), Key([mod], "p", lazy.spawn('xset s activate'), desc="Lock Session"), Key([mod], "r", lazy.spawn(rofi), desc="Launch rofi"), diff --git a/.local/bin/grade b/.local/bin/grade new file mode 100755 index 0000000..61f705a --- /dev/null +++ b/.local/bin/grade @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +git checkout -b grade +git add grade.adoc +git commit -m "Add grade" +git push --set-upstream origin grade diff --git a/.local/bin/set_audio_sink b/.local/bin/set_audio_sink new file mode 100755 index 0000000..360148b --- /dev/null +++ b/.local/bin/set_audio_sink @@ -0,0 +1,19 @@ +#!/bin/sh + +# Load the module until it fails +while pactl load-module module-detect; do + : +done + + +if [ "$DISPLAY" = ":0" ]; then + if ! pactl set-default-sink alsa_output.0.hdmi-stereo; then + pactl set-default-sink alsa_output.1.hdmi-stereo + fi + echo "$DISPLAY set audio" +elif [ "$DISPLAY" = ":10.0" ]; then + pactl set-default-sink xrdp-sink + echo "$DISPLAY set audio" +else + echo "The DISPLAY variable is set to: $DISPLAY, but not to :0 or :10.0" +fi diff --git a/.local/bin/weather b/.local/bin/weather new file mode 100755 index 0000000..b60d2bf --- /dev/null +++ b/.local/bin/weather @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +curl wttr.in/Grovetown