#!/usr/bin/env bash ######################################################## # Misc ######################################################## # https://askubuntu.com/a/30414 is_full_screen() { local WINDOW=$(xwininfo -id "$(xdotool getactivewindow)" -stats \ | grep -E '(Width|Height):' \ | awk '{print $NF}' \ | sed -e 's/ /x/') local SCREEN=$(xdpyinfo | grep -m1 dimensions | awk '{print $2}') if [ "$WINDOW" = "$SCREEN" ]; then return 0 fi return 1 } ytm() { youtube-dl \ --extract-audio \ --audio-format flac \ --audio-quality 0 \ --format bestaudio \ --write-info-json \ --output "$HOME/Downloads/ytm/%(playlist_title)s/%(channel)s - %(title)s.%(ext)s" \ "$@" }