-
-
Save madx/21297 to your computer and use it in GitHub Desktop.
Little personal snippets and tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
puts $stdin.read.gsub(Regexp.new(ARGV[0]), ARGV[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case "$1" in | |
"playlist") | |
playlist=$( | |
xmms2 list | | |
egrep '^->' -A 5 -B 5 | | |
sed 's/^ //g' | | |
gsub ' \(\d\d:\d\d\)' '' | | |
gsub '^->(.+)$' '<b>\1</b>' | | |
gsub '\[(\d+)/\d+\]' '\1 -') | |
notify-send -t 4000 'Playlist:' "$playlist" | |
;; | |
"jump") | |
id=$(xmms2 list | head -n-2 | | |
sed 's/^ //g' | | |
gsub '^->' "" | | |
gsub ' \(\d\d:\d\d\)' '' | | |
gsub '\[(\d+)/\d+\]' "\1" | | |
ruby -Ku -e ' | |
$stdin.read.each_line{ |l| | |
puts l.split(" ")[0], l.gsub(/^\d+ /, "") | |
} | |
' | | |
zenity --list --width 500 --height 600 --column '#' --column 'Song') | |
xmms2 jump $id | |
;; | |
esac | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment