Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- resize_recoordinate_vlc()
- {
- for i in $(seq 1 20); do
- sleep 0.2
- if xdotool getactivewindow getwindowname | grep 'VLC media player'; then
- xdotool windowsize $(xdotool getactivewindow) $1 $2
- xdotool windowmove $(xdotool getactivewindow) $3 $4
- break
- fi
- done
- }
- copy_chromium_address()
- {
- xdotool key alt+d
- xdotool key ctrl+c
- }
- active_window_title_matches()
- {
- xdotool getactivewindow getwindowname | grep -q "$1"
- }
- if active_window_title_matches 'Twitch - Chromium'; then
- copy_chromium_address
- if xclip -o | grep -q 'https://www.twitch.tv/videos'; then
- vlc --no-qt-video-autoresize $(xclip -o) &
- resize_recoordinate_vlc 1280 $((720+104)) 270 $((212-26))
- elif xclip -o | grep -q 'https://www.twitch.tv'; then
- vlc --no-qt-video-autoresize --qt-minimal-view $(xclip -o) &
- resize_recoordinate_vlc 1280 720 270 212
- fi
- elif active_window_title_matches ' - YouTube - Chromium'; then
- copy_chromium_address
- if xclip -o | grep -q 'https://www.youtube.com/watch'; then
- vlc --no-qt-video-autoresize $(xclip -o) &
- fi
- resize_recoordinate_vlc 1280 824 313 116
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement