Skip to content

Instantly share code, notes, and snippets.

View koonix's full-sized avatar
🦆
honk

koonix

🦆
honk
View GitHub Profile
@koonix
koonix / mpvmusic.sh
Last active January 3, 2022 17:50
Play music in terminal via mpv.
#!/bin/sh
clear -x; tput civis # hide cursor
mpv \
--audio-display=no --term-osd-bar --force-window=no \
--keep-open=yes --display-tags-clr --term-title='mpv' \
--msg-level=cplayer=error,ffmpeg=fatal,ffmpeg/demuxer=error \
--term-status-msg='File: ${filename}\n\nTitle: ${metadata/by-key/title}\nArtist: ${metadata/by-key/artist}\nAlbum: ${metadata/by-key/album}\n\n${!playlist-count==1:Playing ${playlist-pos-1}/${playlist-count}\n}${?pause==yes:(Paused) }${time-pos} / ${duration}' \
--term-osd-bar-chars='[-> ]' "$@"
tput cnorm # cursor back to normal
@koonix
koonix / mount-adb.sh
Last active May 23, 2021 15:53
[Bash Script] Mount android phones via ADB on linux.
#!/bin/bash
# access the storage of android devices
# through adb via adbfs.
# requires adbfs-rootless.
# config
mnt=~/Mount/ADB
main () {
while true; do
@koonix
koonix / live-wallpaper.sh
Last active February 17, 2022 20:32
Set live wallpapers on linux.
#!/bin/sh
# soystemd 2021-04-10 (https://github.com/soystemd)
# sets a video or gif as your wallpaper.
# requires mpv, xwinwrap and xrandr.
# to kill the live wallpaper, just run this with no arguments.
#
# example:
# $ live video.mp4
#
# for killing:
@koonix
koonix / mount-mtp.sh
Last active July 1, 2021 10:25
[Bash Script] Mount and open android phones automatically. Uses simple-mtpfs(1).
#!/bin/sh
# this script looks for connected android or MTP devices
# for 30 seconds, and mounts them when connected.
# if any device is already mounted, it just opens them.
# requires simple-mtpfs(1).
# config
mnt=~/Mount/MTP
file_manager="${FILE:-xdg-open}"