diff --git a/private_dot_config/hypr/land/binds.conf b/private_dot_config/hypr/land/binds.conf index e8f5c7d..f876bb7 100644 --- a/private_dot_config/hypr/land/binds.conf +++ b/private_dot_config/hypr/land/binds.conf @@ -12,6 +12,8 @@ bind = CTRL, Print, exec, $screenshot bind = $mod CTRL, p, exec, $screenshot bind = , Print, exec, $rec bind = $mod, p, exec, $rec +bind = $mod, m, exec, $np 1 +bind = $mod SHIFT, m, exec, $np bind = $mod, Q, killactive bind = $mod, F, fullscreen diff --git a/private_dot_config/hypr/land/defaults.conf b/private_dot_config/hypr/land/defaults.conf index df04cf9..1efa63a 100644 --- a/private_dot_config/hypr/land/defaults.conf +++ b/private_dot_config/hypr/land/defaults.conf @@ -16,5 +16,6 @@ $menu = /usr/bin/rofi -show drun -theme ~/.config/rofi/themes/launcher-theme.ras # Screenshotting $screenshot = ~/.config/hypr/scripts/recording.sh $rec = mkdir -p ~/Pictures/Screenshots && grim -t ppm -o "$(hyprctl activeworkspace -j | jq -r '.monitor')" - | satty --early-exit --copy-command "wl-copy" -f - -o ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png +$np = ~/.config/hypr/scripts/np.sh # Other applications $browser = /usr/bin/firefox diff --git a/private_dot_config/hypr/scripts/executable_np.sh b/private_dot_config/hypr/scripts/executable_np.sh new file mode 100755 index 0000000..a31897b --- /dev/null +++ b/private_dot_config/hypr/scripts/executable_np.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +NOTI_ST=string:np:error +NOTI_TIME=5000 + +for i in "playerctl" "wl-copy" "hyprctl" "notify-send"; do + if builtin type -P "$i" &> /dev/null; then continue; fi + + notify-send -h $NOTI_ST -t $NOTI_TIME "Missing dependencies, can't record."; + echo "Missing dependencies." + exit 1 +done + +players="$(playerctl -l 2>&1)" +if echo "$players" | grep 'No players found'; then + notify-send -h $NOTI_ST -t $NOTI_TIME "No active player" + exit 1 +fi + +player="$(echo "$players" | grep spot | head -n 1)" +if [ -z "$player" ]; then + player="$(echo "$players" | head -n 1)" +fi + + +data=$(playerctl metadata -p "$player" --format $'{{title}}\x1F{{xesam:url}}\x1F{{artist}}\x1F{{album}}') +IFS=$'\x1F' read -r title url artist album <<< "$data" +output=$'## Now Playing\n>' + +if [ -z "$title" ]; then + notify-send -h $NOTI_ST -t $NOTI_TIME "This song doesn't have a title. Not much to do here."; + exit 1; +fi +if [ -z "$url" ]; then + output="$output $title" +else + output="$output [$title](<$url>)"$'\n' +fi +if [ -n "$artist" ]; then + output="$output\- **$artist**" +fi +if [ -n "$artist" ] && [ -n "$album" ]; then + output="$output on *$album*" +fi + +echo "$output" | wl-copy + +hyprctl dispatch sendshortcut "CTRL,V," +if [[ "$@" == "1" ]]; then + hyprctl dispatch sendshortcut ",Return," +fi diff --git a/private_dot_config/wireplumber/wireplumber.conf.d/51-bluez-avrcp.conf b/private_dot_config/wireplumber/wireplumber.conf.d/51-bluez-avrcp.conf new file mode 100644 index 0000000..144b966 --- /dev/null +++ b/private_dot_config/wireplumber/wireplumber.conf.d/51-bluez-avrcp.conf @@ -0,0 +1,5 @@ +monitor.bluez.properties = { + # Enable dummy AVRCP player for proper media control support + # This is required for AirPods and other devices to send play/pause/skip commands + bluez5.dummy-avrcp-player = true +}