Created
May 16, 2014 23:57
-
-
Save underr/c376645f79a9ea9e6055 to your computer and use it in GitHub Desktop.
recent files
This file contains 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/sh | |
DATA_PATH="`kde4-config --path data`" | |
DATA_PATH="${DATA_PATH%%:*}" | |
STREAM="<submenu>" | |
for file in "${DATA_PATH}RecentDocuments/"*; do | |
eval "`sed -r '/^(Icon|Name|URL|X-KDE-LastOpenedWith).*/!d; s/URL\[.[^\]]*/URL/g; s/X-KDE-LastOpenedWith/La | |
LastOpenedWith="${LastOpenedWith:-kfmclient open}" | |
STREAM="${STREAM}<action label=\"${Name}\" icon=\"${Icon}\" exec=\"${LastOpenedWith} '${URL}'\" />\n" | |
# echo $Icon $Name $URL | |
done | |
STREAM="${STREAM}</submenu>" | |
echo $STREAM > "${DATA_PATH}be.shell/MainMenu/RecentFiles.xml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment