自己的shell script - Linux

Table of Contents

版上似乎很少人分享shell script

各位自己寫和常用的script有哪些呢?



像我有個叫realmansearch(!)的script

http://pastebin.com/PEF7paAv

可以在terminal裡打 realmansearch og ptt

就會在firefox幫你google ptt (og = open google)

打realmansearch toy foo

會幫你開一個新的分頁後在youtube搜尋foo (toy = tab open youtube)

然後wow (window open wikipedia) oap (open archlinux package)等等

用的時候我是把realmansearch og alias成 og 這樣打指令比較快



另外我用mpd聽音樂 看youtube時用youtube-viewer(可以不用進youtube網頁)

可是逛ptt時遇到youtube連結要暫停音樂很麻煩

所以我寫了個urlfilter http://pastebin.com/aD6RdYrn (dependency: bc mpc)

把urlfilter設成terminal開啟連結的預設軟體

這樣開youtube以外的連結就開firefox

而開youtube連結會暫停正在聽的音樂->看影片->回復之前暫停的音樂

為了不傷耳朵還另外多寫了fade in/out的功能



拋磚引玉一下XD 希望看到各式各樣方便的script

--

All Comments

Joe avatarJoe2012-09-05
我有寫一個mymount, 把老是記不住的mount選項捆一綑
Adele avatarAdele2012-09-09
還有批次轉UTF-8, 轉mp3檔這類抄來改參數的小工具