Added np thing and airpod bluetooth fixy
This commit is contained in:
parent
f314910d8b
commit
7d61371ec0
4 changed files with 59 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ bind = CTRL, Print, exec, $screenshot
|
||||||
bind = $mod CTRL, p, exec, $screenshot
|
bind = $mod CTRL, p, exec, $screenshot
|
||||||
bind = , Print, exec, $rec
|
bind = , Print, exec, $rec
|
||||||
bind = $mod, p, 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, Q, killactive
|
||||||
bind = $mod, F, fullscreen
|
bind = $mod, F, fullscreen
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,6 @@ $menu = /usr/bin/rofi -show drun -theme ~/.config/rofi/themes/launcher-theme.ras
|
||||||
# Screenshotting
|
# Screenshotting
|
||||||
$screenshot = ~/.config/hypr/scripts/recording.sh
|
$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
|
$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
|
# Other applications
|
||||||
$browser = /usr/bin/firefox
|
$browser = /usr/bin/firefox
|
||||||
|
|
|
||||||
51
private_dot_config/hypr/scripts/executable_np.sh
Executable file
51
private_dot_config/hypr/scripts/executable_np.sh
Executable file
|
|
@ -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
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue