Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- list="<item>English [en]</item>
- <item>French [fr]</item>
- <item>Hungarian [hu]</item>
- "
- mylist="$(echo $list)"
- mylast_to="$(echo $mylist)"
- mylast_from="$(echo $mylist)"
- file_last_to="/tmp/last_to.txt"
- file_last_from="/tmp/last_from.txt"
- if [ -e $file_last_to ]; then
- mylast_to="<item>"`cat "$file_last_to"`"</item>""$mylist"
- #else
- # mylist=$(cat "$file_lang")
- fi
- if [ -e $file_last_from ]; then
- mylast_from="<item>"`cat "$file_last_from"`"</item>""$mylist"
- #else
- # mylist=$(cat "$file_lang")
- fi
- export MAIN='
- <vbox>
- <hbox>
- <text width-chars="5">
- <label>From:</label>
- </text>
- <combobox allow-empty="true" case-sensitive="true" value-in-list="true" tooltip-text="Source language">
- <variable>FROM</variable>
- '$mylast_from'
- </combobox>
- <text width-chars="5">
- <label>To:</label>
- </text>
- <combobox allow-empty="true" case-sensitive="true" value-in-list="true" tooltip-text="Target language">
- <variable>TO</variable>
- '$mylast_to'
- </combobox>
- </hbox>
- <button tooltip-text="Swap languages">
- <label>"Swap"</label>
- <input file stock="gtk-refresh"></input>
- <action>echo $FROM > /tmp/last_to.txt</action>
- <action>echo $TO > /tmp/last_from.txt</action>
- <action>exit:SWAP</action>
- </button>
- <button tooltip-text="Close">
- <label>"Close"</label>
- <input file stock="gtk-quit"></input>
- <action>exit:CLOSE</action>
- </button>
- </vbox>'
- eval "`gtkdialog -p MAIN --center`"
- if [ "$EXIT" == "SWAP" ];then
- "$0" && exit
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement