| злой (иногда очень) Ананас ( @ 2009-11-02 22:52:00 |
| Current music: | Afric Simone - To Do Pasara Maria |
| Entry tags: | comps, links, programs, tips, work |
давеча вот зарелизил форк zenity
практическое применение это говна
results=$(mktemp --tmpdir autostart.XXXXXXXXXX)
for f in ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/*.desktop; do
grep -m 1 -e '^[[:blank:]]*Exec' $f | cut -d = -f 2
grep -m 1 -e '^[[:blank:]]*Name' $f | cut -d = -f 2
grep -m 1 -e '^[[:blank:]]*Comment' $f | cut -d = -f 2
done | yad --width=500 --height=300 --title="Autostart editor" --image="gtk-execute" --text="Add/remove autostart items" \
--list --editable --print-all --multiple --column="Command" --column="Name" --column="Description" > $results
if [[ $? -eq 0 ]]; then
rm -f ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/*.desktop
cat $results | while read line; do
eval $(echo $line | awk -F'|' '{printf "export NAME=\"%s\" COMMENT=\"%s\" COMMAND=\"%s\"", $2, $3, $1}')
cat > ${XDG_CONFIG_HOME:-$HOME/.config}/autostart/$NAME.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=$NAME
Comment=$COMMENT
Exec=$COMMAND
StartupNotify=true
Terminal=false
EOF
done
fi
rm -f $results
exit 0
выглядит так
