From 8f8bede1a96394f188b6f95bf20de45084e0f005 Mon Sep 17 00:00:00 2001 From: joygnu Date: Thu, 20 Jun 2024 14:12:04 +0200 Subject: [PATCH] mocp --- home/hyprland/default.nix | 10 +++++++--- home/hyprland/pause.sh | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 home/hyprland/pause.sh diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 398236a..c4f93f0 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -8,7 +8,6 @@ lxqt.lxqt-policykit grim slurp - swappy hyprpicker emote ]; @@ -37,8 +36,13 @@ "$mod" = "SUPER"; bind = [ - "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + "$mod, P, exec, mocp -f" + "$mod, O, exec, mocp -r" + "$mod, U, exec, mocp --volume +5" + "$mod, I, exec, mocp --volume -5" + "$mod+space, exec, sh ~/nix/home/hyprland/pause.sh" "$mod, N, exec, alacritty -e mocp" + "$mod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" "$mod, B, exec, emote &" "$mod+Shift, Z, exec, grim - | swappy -f -" "$mod, Z, exec, sh ~/nix/home/hyprland/screen.sh &" @@ -54,7 +58,7 @@ "$mod, Q, killactive" "$mod, M, exit, hyprland" "$mod, W, togglefloating" - "$mod, U, exec, systemctl suspend" + "$mod, T, exec, systemctl suspend" "$mod, L, exec, amixer -q sset Master 5%+" "$mod, K, exec, amixer -q sset Master 5%-" "$mod, Return, fullscreen" diff --git a/home/hyprland/pause.sh b/home/hyprland/pause.sh new file mode 100755 index 0000000..87c0ed9 --- /dev/null +++ b/home/hyprland/pause.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Get the current state of MOC +state=$(mocp -Q %state) + +# Check the state and toggle accordingly +if [ "$state" == "PLAY" ]; then + mocp -P +elif [ "$state" == "PAUSE" ]; then + mocp -U +else + echo "MOC is not currently playing or paused." +fi +