slitaz-tools annotate tinyutils/desktopbox @ rev 340
tazx: Moved doc to Handbook
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 04 23:12:18 2009 +0200 (2009-05-04) |
parents | edffcc2c8ef5 |
children | 0fb7be34b43b |
rev | line source |
---|---|
pankso@178 | 1 #! /bin/sh |
pankso@189 | 2 # |
MikeDSmith25@252 | 3 # Multi-call script providing GTK boxes to manage a desktop following |
MikeDSmith25@252 | 4 # Freedesktop standards. |
pankso@178 | 5 # |
pankso@178 | 6 # (C) GNU gpl v3 - SliTaz GNU/Linux 2008. |
pankso@178 | 7 # |
pankso@335 | 8 VERSION=20090428 |
pankso@178 | 9 |
pankso@189 | 10 # Glade XML file path. |
pankso@189 | 11 GLADE_XML=/usr/share/slitaz-tools/glade |
pankso@296 | 12 # Export script path and other if needed so we can use them in 'quote'. |
pankso@296 | 13 export BIN=$0 |
pankso@296 | 14 export AUTOSTART_SCRIPT=$HOME/.config/openbox/autostart.sh |
pankso@189 | 15 |
MikeDSmith25@252 | 16 # Standard directories. |
pankso@178 | 17 mkdir -p $HOME/Desktop $HOME/.local/share/applications |
pankso@178 | 18 |
pankso@178 | 19 # Get the active locale (default to English). |
pankso@178 | 20 case $LANG in |
pankso@178 | 21 es*) |
pankso@178 | 22 lang="es" |
MikeDSmith25@252 | 23 NEW_FOLDER_LABEL="Create a new folder on the desktop:" |
pankso@178 | 24 FOLDER_ENTRY_MSG="dirname" |
MikeDSmith25@252 | 25 NEW_FILE_LABEL="Create a new file on the desktop:" |
pankso@178 | 26 FILE_ENTRY_MSG="filename" |
pankso@187 | 27 ADD_ICON_LABEL="Add some desktop icons" |
pankso@282 | 28 CHARS_SIZE="64" |
pascal@268 | 29 DESKTOP_DIALOG_TAZUSB="Save filesystem using compression" |
pankso@282 | 30 DESKTOP_DIALOG_LABEL="Session logout, system shutdown or reboot" |
pankso@282 | 31 DESKTOP_LOGOUT_BUTTON="Logout X session" |
pankso@282 | 32 DESKTOP_SHUTDOWN_BUTTON="Shutdown computer" |
pankso@282 | 33 DESKTOP_REBOOT_BUTTON="Reboot system" ;; |
pankso@178 | 34 fr*) |
pankso@178 | 35 lang="fr" |
pascal@281 | 36 NEW_FOLDER_LABEL="Créer un nouveau dossier sur le bureau:" |
pankso@178 | 37 FOLDER_ENTRY_MSG="dossier" |
pascal@281 | 38 NEW_FILE_LABEL="Créer un nouveau fichier sur le bureau:" |
pankso@178 | 39 FILE_ENTRY_MSG="fichier" |
pascal@281 | 40 ADD_ICON_LABEL="Ajouter des icônes de bureau" |
pankso@282 | 41 CHARS_SIZE="72" |
pascal@281 | 42 DESKTOP_DIALOG_TAZUSB="Enregistrer le système avec la compression" |
pankso@282 | 43 DESKTOP_DIALOG_LABEL="Déconnexion, arrêt ou redémarrage du système" |
pankso@282 | 44 DESKTOP_LOGOUT_BUTTON="Fermer la session X" |
pankso@282 | 45 DESKTOP_SHUTDOWN_BUTTON="Eteindre le système" |
pankso@282 | 46 DESKTOP_REBOOT_BUTTON="Redémarrer le système" ;; |
pankso@178 | 47 *) |
pankso@178 | 48 lang="" |
MikeDSmith25@252 | 49 NEW_FOLDER_LABEL="Create a new folder on the desktop:" |
pankso@178 | 50 FOLDER_ENTRY_MSG="dirname" |
MikeDSmith25@252 | 51 NEW_FILE_LABEL="Create a new file on the desktop:" |
pankso@178 | 52 FILE_ENTRY_MSG="filename" |
pankso@187 | 53 ADD_ICON_LABEL="Add some desktop icons" |
pankso@282 | 54 CHARS_SIZE="64" |
pascal@268 | 55 DESKTOP_DIALOG_TAZUSB="Save filesystem using compression" |
pankso@282 | 56 DESKTOP_DIALOG_LABEL="Session logout, system shutdown or reboot" |
pankso@282 | 57 DESKTOP_LOGOUT_BUTTON="Logout X session" |
pankso@282 | 58 DESKTOP_SHUTDOWN_BUTTON="Shutdown computer" |
pankso@282 | 59 DESKTOP_REBOOT_BUTTON="Reboot system" ;; |
pankso@178 | 60 esac |
pankso@178 | 61 |
pankso@178 | 62 # Command line usage. |
pankso@178 | 63 usage() |
pankso@178 | 64 { |
pankso@178 | 65 echo -e "\nSliTaz Freedesktop Box - Version: $VERSION\n |
pankso@178 | 66 \033[1mUsage: \033[0m `basename $0` command |
pankso@178 | 67 \033[1mCommands: \033[0m\n |
MikeDSmith25@252 | 68 new-folder Create a new folder on the desktop with mkdir. |
MikeDSmith25@252 | 69 new-file Create a new empty file or SHell script on the desktop. |
paul@317 | 70 add-icons Add a system icon to the desktop. |
MikeDSmith25@252 | 71 calendar Display a calendar under mouse pointer. |
pankso@294 | 72 notify Display a notification message (center/no decoration). |
pankso@294 | 73 Ex: `basename $0` notify \"Message to display\" 4 |
pankso@296 | 74 autostart Manage autostarted applications with Openbox. |
pankso@187 | 75 logout Prompt for X session exit or system halt/reboot.\n" |
pankso@178 | 76 } |
pankso@178 | 77 |
pankso@296 | 78 # Openbox autostart functions, first column is used for icon |
pankso@296 | 79 autostart_list() |
pankso@296 | 80 { |
pankso@296 | 81 # Enabled |
pankso@296 | 82 for app in `cat $AUTOSTART_SCRIPT | grep ^[a-z] | awk '{ print $1 }'` |
pankso@296 | 83 do |
pankso@296 | 84 comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//` |
pankso@296 | 85 [ -x /usr/bin/$app ] && echo "go-next | $app | $comment" |
pankso@296 | 86 done |
pankso@296 | 87 # Disabled |
pankso@296 | 88 for app in `cat $AUTOSTART_SCRIPT | grep ^#[a-z] | awk '{ print $1 }'` |
pankso@296 | 89 do |
pankso@296 | 90 comment=`grep -B 1 "^$app" $AUTOSTART_SCRIPT | grep '^# ' | sed s/'#'//` |
pankso@296 | 91 app=${app#\#} |
pankso@296 | 92 [ -x /usr/bin/$app ] && echo "stop | $app | $comment" |
pankso@296 | 93 done |
pankso@296 | 94 } |
pankso@296 | 95 |
pankso@296 | 96 # Enable or disbale autostarted applications. |
pankso@296 | 97 autostart_actions() |
pankso@296 | 98 { |
pankso@296 | 99 if grep -q "^$APPLICATION" $AUTOSTART_SCRIPT; then |
pankso@296 | 100 sed -i s/"^$APPLICATION"/"\#$APPLICATION"/ $AUTOSTART_SCRIPT |
pankso@296 | 101 else |
pankso@296 | 102 sed -i s/"^\#$APPLICATION"/"$APPLICATION"/ $AUTOSTART_SCRIPT |
pankso@296 | 103 fi |
pankso@296 | 104 } |
pankso@296 | 105 |
pankso@296 | 106 add_autostarted_app() |
pankso@296 | 107 { |
pankso@296 | 108 if ! grep -q "^$NEW_APP" $AUTOSTART_SCRIPT; then |
pankso@296 | 109 NEW_APP=`echo $NEW_APP | sed s/'&'/''/` |
pankso@296 | 110 echo "" >> $AUTOSTART_SCRIPT |
pankso@296 | 111 echo "# $NEW_COMMENT" >> $AUTOSTART_SCRIPT |
pankso@296 | 112 echo "$NEW_APP &" >> $AUTOSTART_SCRIPT |
pankso@296 | 113 fi |
pankso@296 | 114 } |
pankso@296 | 115 |
pankso@296 | 116 add_autostarted_app_box() |
pankso@296 | 117 { |
pankso@296 | 118 export ADD_AUTO_START_BOX=' |
pankso@296 | 119 <window title="Add auto started applications" icon-name="preferences-system-session"> |
pankso@296 | 120 <vbox> |
pankso@296 | 121 <text width-chars="54"> |
pankso@296 | 122 <label>" |
pankso@296 | 123 Add a new application starting with your session |
pankso@296 | 124 "</label> |
pankso@296 | 125 </text> |
pankso@296 | 126 <hbox> |
pankso@296 | 127 <text> |
pankso@296 | 128 <label>"Application:"</label> |
pankso@296 | 129 </text> |
pankso@296 | 130 <entry> |
pankso@296 | 131 <variable>NEW_APP</variable> |
pankso@296 | 132 </entry> |
pankso@296 | 133 </hbox> |
pankso@296 | 134 <hbox> |
pankso@296 | 135 <text> |
pankso@296 | 136 <label>"Comment: "</label> |
pankso@296 | 137 </text> |
pankso@296 | 138 <entry> |
pankso@296 | 139 <variable>NEW_COMMENT</variable> |
pankso@296 | 140 </entry> |
pankso@296 | 141 </hbox> |
pankso@296 | 142 <hbox> |
pankso@296 | 143 <button ok> |
pankso@296 | 144 <action>$BIN add_autostarted_app</action> |
pankso@296 | 145 <action type="exit">exit</action> |
pankso@296 | 146 </button> |
pankso@296 | 147 <button cancel></button> |
pankso@296 | 148 </hbox> |
pankso@296 | 149 </vbox> |
pankso@296 | 150 </window>' |
pankso@296 | 151 gtkdialog --center --program=ADD_AUTO_START_BOX |
pankso@296 | 152 } |
pankso@296 | 153 |
pankso@178 | 154 # Box commands. |
pankso@296 | 155 |
pankso@178 | 156 case $1 in |
pankso@178 | 157 new-folder) |
MikeDSmith25@252 | 158 # Create a directory on the ~/Desktop. |
pankso@178 | 159 # |
pankso@178 | 160 DESKTOP_DIALOG=" |
pankso@178 | 161 <window title=\"Desktopbox - mkdir\" icon-name=\"folder-new\"> |
pankso@178 | 162 <vbox> |
pankso@178 | 163 |
pankso@178 | 164 <text use-markup=\"true\" width-chars=\"40\"> |
pankso@178 | 165 <label>\" |
pankso@178 | 166 <b>$NEW_FOLDER_LABEL</b>\" |
pankso@178 | 167 </label> |
pankso@178 | 168 </text> |
pankso@189 | 169 |
pankso@178 | 170 <hbox> |
pankso@178 | 171 <entry> |
pankso@178 | 172 <default>$FOLDER_ENTRY_MSG</default> |
pankso@178 | 173 <variable>DIR</variable> |
pankso@178 | 174 </entry> |
pankso@178 | 175 </hbox>" |
pankso@178 | 176 ACTIONS=' |
pankso@178 | 177 <hbox> |
pankso@178 | 178 <button> |
pankso@178 | 179 <label>Mkdir</label> |
pankso@178 | 180 <input file icon="folder-new"></input> |
pankso@178 | 181 <action>mkdir -p "$HOME/Desktop/$DIR"</action> |
pankso@178 | 182 <action type="exit">Exit</action> |
pankso@178 | 183 </button> |
pankso@178 | 184 <button cancel> |
pankso@178 | 185 <action type="exit">Exit</action> |
pankso@178 | 186 </button> |
pankso@178 | 187 </hbox> |
pankso@178 | 188 |
pankso@178 | 189 </vbox> |
pankso@178 | 190 </window>' |
pankso@178 | 191 export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;; |
pankso@178 | 192 new-file) |
MikeDSmith25@252 | 193 # Create a file on the ~/Desktop. |
pankso@178 | 194 # |
pankso@178 | 195 DESKTOP_DIALOG=" |
pankso@178 | 196 <window title=\"Desktopbox - touch/cat\" icon-name=\"document-new\"> |
pankso@178 | 197 <vbox> |
pankso@178 | 198 <text use-markup=\"true\" width-chars=\"40\"> |
pankso@178 | 199 <label>\" |
pankso@178 | 200 <b>$NEW_FILE_LABEL</b>\" |
pankso@178 | 201 </label> |
pankso@178 | 202 </text> |
pankso@189 | 203 |
pankso@178 | 204 <hbox> |
pankso@178 | 205 <entry> |
pankso@178 | 206 <default>$FILE_ENTRY_MSG</default> |
pankso@178 | 207 <variable>FILE</variable> |
pankso@178 | 208 </entry> |
pankso@178 | 209 </hbox>" |
pankso@178 | 210 ACTIONS=' |
pankso@178 | 211 <hbox> |
pankso@178 | 212 <button> |
pankso@178 | 213 <label>SH script</label> |
pankso@178 | 214 <input file icon="document-new"></input> |
pankso@178 | 215 <action>echo "#!/bin/sh" > "$HOME/Desktop/$FILE"</action> |
pankso@178 | 216 <action>echo "#" >> "$HOME/Desktop/$FILE"</action> |
pankso@178 | 217 <action>chmod +x "$HOME/Desktop/$FILE"</action> |
pankso@178 | 218 <action type="exit">Exit</action> |
pankso@178 | 219 </button> |
pankso@178 | 220 <button> |
pankso@178 | 221 <label>Empty</label> |
pankso@178 | 222 <input file icon="document-new"></input> |
pankso@178 | 223 <action>touch "$HOME/Desktop/$FILE"</action> |
pankso@178 | 224 <action type="exit">Exit</action> |
pankso@178 | 225 </button> |
pankso@178 | 226 <button cancel> |
pankso@178 | 227 <action type="exit">Exit</action> |
pankso@178 | 228 </button> |
pankso@178 | 229 </hbox> |
pankso@178 | 230 </vbox> |
pankso@178 | 231 </window>' |
pankso@178 | 232 export DESKTOP_DIALOG="${DESKTOP_DIALOG}${ACTIONS}" ;; |
pankso@178 | 233 add-icons) |
MikeDSmith25@252 | 234 # Add new icons on the ~/Desktop from /usr/share/applications. |
pankso@178 | 235 # |
pankso@178 | 236 DESKTOP_DIALOG=" |
pankso@178 | 237 <window title=\"$ADD_ICON_LABEL\" icon-name=\"document-new\"> |
pankso@178 | 238 <vbox> |
pankso@178 | 239 <text use-markup=\"true\" width-chars=\"40\"> |
pankso@178 | 240 <label>\" |
pankso@178 | 241 <b>$ADD_ICON_LABEL</b> |
pankso@178 | 242 \" |
pankso@178 | 243 </label> |
pankso@178 | 244 </text> |
pankso@178 | 245 <tree headers_visible=\"false\"> |
pankso@178 | 246 <width>420</width><height>200</height> |
pankso@178 | 247 <variable>ICON</variable> |
pankso@178 | 248 <label>Filename|Application</label>" |
pankso@178 | 249 # Get application name and icon. |
pankso@178 | 250 cd /usr/share/applications |
pankso@178 | 251 for file in *.desktop |
pankso@178 | 252 do |
pankso@178 | 253 # Try to get the name in the right locale. |
pankso@178 | 254 NAME=`grep ^Name $file | grep $lang || grep ^Name= $file` |
pankso@178 | 255 NAME=`echo $NAME | cut -d "=" -f 2` |
pankso@178 | 256 ICON=`grep ^Icon= $file | cut -d "=" -f 2` |
pankso@178 | 257 ICON=`basename $ICON` |
pankso@178 | 258 ICON=${ICON%.*} |
pankso@178 | 259 FILE=${file%.desktop} |
pankso@178 | 260 ITEM="<item icon=\"$ICON\">$FILE | $NAME</item>" |
pankso@178 | 261 DESKTOP_DIALOG="${DESKTOP_DIALOG}${ITEM}" |
pankso@178 | 262 done |
pankso@178 | 263 ACTIONS='<action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action> |
pankso@178 | 264 </tree> |
pankso@178 | 265 <hbox> |
pankso@178 | 266 <button> |
pankso@178 | 267 <label>Add</label> |
pankso@178 | 268 <input file icon="gtk-add"></input> |
pankso@178 | 269 <action>cp /usr/share/applications/$ICON.desktop ~/Desktop</action> |
pankso@178 | 270 </button> |
pankso@178 | 271 <button> |
pankso@178 | 272 <label>Exit</label> |
pankso@178 | 273 <input file icon="exit"></input> |
pankso@178 | 274 <action type="exit">Exit</action> |
pankso@178 | 275 </button> |
pankso@178 | 276 </hbox> |
pankso@178 | 277 </vbox> |
pankso@187 | 278 </window>' |
pankso@187 | 279 export DESKTOP_DIALOG=${DESKTOP_DIALOG}${ACTIONS} ;; |
pankso@189 | 280 calendar) |
pankso@189 | 281 # Calendar using glade file. |
pankso@189 | 282 # |
pankso@189 | 283 gtkdialog --glade-xml=$GLADE_XML/calendar.glade \ |
pankso@189 | 284 --program=MAIN_WINDOW ;; |
pankso@187 | 285 logout) |
pankso@187 | 286 # X session/system logout. |
pankso@187 | 287 # |
pankso@187 | 288 DESKTOP_DIALOG=" |
pankso@294 | 289 <window title=\"SliTaz Desktop logout\" icon-name=\"user-desktop\" skip_taskbar_hint=\"true\"> |
pankso@187 | 290 <vbox> |
pankso@187 | 291 <pixmap> |
pankso@187 | 292 <input file>/usr/share/icons/Tango/32x32/places/user-desktop.png</input> |
pankso@187 | 293 </pixmap> |
pankso@187 | 294 <hbox> |
pankso@282 | 295 <text use-markup=\"true\" width-chars=\"$CHARS_SIZE\"> |
pankso@187 | 296 <label> |
pankso@187 | 297 \"<b>$DESKTOP_DIALOG_LABEL</b> |
pankso@187 | 298 \" |
pankso@187 | 299 </label> |
pankso@187 | 300 </text> |
pankso@187 | 301 </hbox>" |
pascal@268 | 302 TAZUSB_DIALOG=" |
pascal@268 | 303 <hbox> |
pascal@268 | 304 <checkbox> |
pascal@268 | 305 <label>$DESKTOP_DIALOG_TAZUSB</label> |
pascal@268 | 306 <variable>TAZUSB_WRITE</variable> |
pascal@268 | 307 <default>false</default> |
pascal@268 | 308 </checkbox> |
pascal@268 | 309 <radiobutton> |
pascal@268 | 310 <label>lzma</label> |
pascal@268 | 311 <variable>LZMA</variable> |
pascal@268 | 312 </radiobutton> |
pascal@268 | 313 <radiobutton active=\"true\"> |
pascal@268 | 314 <label>gzip</label> |
pascal@268 | 315 <variable>GZIP</variable> |
pascal@268 | 316 </radiobutton> |
pascal@268 | 317 <radiobutton> |
pascal@268 | 318 <label>none</label> |
pascal@268 | 319 <variable>NONE</variable> |
pascal@268 | 320 </radiobutton> |
pascal@268 | 321 </hbox>" |
pascal@269 | 322 EXTRA="COMP=none; [ \$LZMA = true ] && COMP=lzma; [ \$GZIP = true ] && COMP=gzip; [ \$TAZUSB_WRITE = true ] && { subox \"xterm -e '/usr/bin/tazusb writefs \$COMP'\"; sleep 1; while ps x | grep -v grep | grep -q tazusb; do sleep 1; done; };" |
pascal@269 | 323 [ -f /home/boot/rootfs.gz ] || { TAZUSB_DIALOG=""; EXTRA=""; } |
pankso@187 | 324 # Logout for Openbox or JWM and system shutdown or reboot. |
pascal@268 | 325 ACTIONS=" |
pankso@187 | 326 <hbox> |
pankso@187 | 327 <button> |
pankso@282 | 328 <label>$DESKTOP_LOGOUT_BUTTON</label> |
pascal@268 | 329 <input file icon=\"video-display\"></input> |
pascal@269 | 330 <action>$EXTRA openbox --exit || jwm -exit</action> |
pascal@268 | 331 <action type=\"exit\">Exit</action> |
pankso@187 | 332 </button> |
pankso@187 | 333 <button> |
pankso@282 | 334 <label>$DESKTOP_SHUTDOWN_BUTTON</label> |
pascal@268 | 335 <input file icon=\"system-shutdown\"></input> |
pascal@269 | 336 <action>$EXTRA poweroff</action> |
pascal@268 | 337 <action type=\"exit\">Exit</action> |
pankso@187 | 338 </button> |
pankso@187 | 339 <button> |
pankso@282 | 340 <label>$DESKTOP_REBOOT_BUTTON</label> |
pascal@268 | 341 <input file icon=\"reload\"></input> |
pascal@269 | 342 <action>$EXTRA reboot</action> |
pascal@268 | 343 <action type=\"exit\">Exit</action> |
pankso@187 | 344 </button> |
pankso@187 | 345 <button cancel> |
pascal@268 | 346 <action type=\"exit\">Exit</action> |
pankso@187 | 347 </button> |
pankso@187 | 348 </hbox> |
pankso@187 | 349 </vbox> |
pascal@268 | 350 </window>" |
pascal@268 | 351 export DESKTOP_DIALOG=${DESKTOP_DIALOG}${TAZUSB_DIALOG}${ACTIONS} ;; |
pankso@294 | 352 notify) |
pankso@294 | 353 # Nofification message without window decoration. |
pankso@294 | 354 MSG="$2" |
pankso@294 | 355 SEC=$3 |
pankso@295 | 356 [ -z $SEC ] && SEC=4 |
pankso@294 | 357 export NOTIFY_BOX=" |
pankso@294 | 358 <window decorated=\"false\" skip_taskbar_hint=\"true\"> |
pankso@294 | 359 <vbox> |
pankso@294 | 360 <text width-chars=\"64\" use-markup=\"true\"> |
pankso@294 | 361 <label>\" |
pankso@295 | 362 <b>$MSG</b> |
pankso@294 | 363 \"</label> |
pankso@294 | 364 </text> |
pankso@294 | 365 </vbox> |
pankso@294 | 366 </window>" |
pankso@294 | 367 gtkdialog --center --program=NOTIFY_BOX >/dev/null & |
pankso@294 | 368 sleep $SEC |
pankso@294 | 369 pid=`ps | grep NOTIFY_BOX | awk '{ print $1 }'` |
pankso@294 | 370 kill $pid 2>/dev/null |
pankso@294 | 371 exit 0 ;; |
pankso@296 | 372 autostart) |
pankso@296 | 373 # Autostarted apps management. Functions are used for input |
pankso@296 | 374 # and actions |
pankso@296 | 375 export DESKTOP_DIALOG=' |
pankso@296 | 376 <window title="Auto start applications with Openbox" icon-name="preferences-system-session"> |
pankso@296 | 377 <vbox> |
pankso@296 | 378 <tree> |
pankso@296 | 379 <width>540</width><height>200</height> |
pankso@296 | 380 <variable>APPLICATION</variable> |
pankso@296 | 381 <label>Application|Comment</label> |
pankso@296 | 382 <input icon_column="0">$BIN autostart_list</input> |
pankso@296 | 383 <action>$BIN autostart_actions</action> |
pankso@296 | 384 <action>refresh:APPLICATION</action> |
pankso@296 | 385 </tree> |
pankso@296 | 386 <hbox> |
pankso@296 | 387 <text width-chars="36"> |
pankso@296 | 388 <label> |
paul@310 | 389 "Double click to enable/disable an application" |
pankso@296 | 390 </label> |
pankso@296 | 391 </text> |
pankso@296 | 392 <button> |
pankso@296 | 393 <label>Add</label> |
pankso@296 | 394 <input file icon="gtk-add"></input> |
pankso@296 | 395 <action>$BIN add_autostarted_app_box</action> |
pankso@296 | 396 <action>refresh:APPLICATION</action> |
pankso@296 | 397 </button> |
pankso@296 | 398 <button> |
pankso@296 | 399 <label>Configuration</label> |
pankso@296 | 400 <input file icon="accessories-text-editor"></input> |
pankso@296 | 401 <action>leafpad $AUTOSTART_SCRIPT</action> |
pankso@296 | 402 <action>refresh:APPLICATION</action> |
pankso@296 | 403 </button> |
pankso@296 | 404 <button> |
pankso@296 | 405 <label>Exit</label> |
pankso@296 | 406 <input file icon="exit"></input> |
pankso@296 | 407 <action type="exit">exit</action> |
pankso@296 | 408 </button> |
pankso@296 | 409 </hbox> |
pankso@296 | 410 </vbox> |
pankso@296 | 411 </window>' |
pankso@296 | 412 ;; |
pankso@335 | 413 tazapps) |
pankso@335 | 414 # Default applications configuration script. System wide config file |
pankso@335 | 415 # is /etc/slitaz/applications.conf and each user can have personnal |
pankso@335 | 416 # settings. System wide for root and personnal config for user. |
pankso@339 | 417 export CONFIG="$HOME/.config/slitaz/applications.conf" |
pankso@339 | 418 if [ ! -f $CONFIG ]; then |
pankso@339 | 419 mkdir -p $HOME/.config/slitaz |
pankso@339 | 420 cp /etc/slitaz/applications.conf $CONFIG |
pankso@335 | 421 fi |
pankso@335 | 422 export DESKTOP_DIALOG=' |
pankso@335 | 423 <window title="SliTaz default applications" icon-name="preferences-desktop"> |
pankso@335 | 424 <vbox> |
pankso@335 | 425 <vbox> |
pankso@339 | 426 <text wrap="false" width-chars="54"> |
pankso@335 | 427 <label>" |
pankso@335 | 428 SliTaz default applications configuration |
pankso@335 | 429 "</label> |
pankso@335 | 430 </text> |
pankso@335 | 431 </vbox> |
pankso@335 | 432 <hbox> |
pankso@335 | 433 <text wrap="false"> |
pankso@339 | 434 <label>"Web browser: "</label> |
pankso@335 | 435 </text> |
pankso@335 | 436 <entry> |
pankso@335 | 437 <input>. $CONFIG; echo $BROWSER</input> |
pankso@335 | 438 <variable>BROWSER</variable> |
pankso@335 | 439 </entry> |
pankso@335 | 440 <button> |
pankso@335 | 441 <label>Change</label> |
pankso@335 | 442 <input file icon="forward"></input> |
pankso@335 | 443 <action>sed -i s/"BROWSER=.*"/"BROWSER=\"$BROWSER\""/ $CONFIG</action> |
pankso@335 | 444 </button> |
pankso@335 | 445 </hbox> |
pankso@335 | 446 <hbox> |
pankso@335 | 447 <text wrap="false"> |
pankso@339 | 448 <label>"Text editor: "</label> |
pankso@335 | 449 </text> |
pankso@335 | 450 <entry> |
pankso@335 | 451 <input>. $CONFIG; echo $EDITOR</input> |
pankso@335 | 452 <variable>EDITOR</variable> |
pankso@335 | 453 </entry> |
pankso@335 | 454 <button> |
pankso@335 | 455 <label>Change</label> |
pankso@335 | 456 <input file icon="forward"></input> |
pankso@335 | 457 <action>sed -i s/"EDITOR=.*"/"EDITOR=\"$EDITOR\""/ $CONFIG</action> |
pankso@335 | 458 </button> |
pankso@335 | 459 </hbox> |
pankso@335 | 460 <hbox> |
pankso@335 | 461 <text wrap="false"> |
pankso@339 | 462 <label>"X terminal: "</label> |
pankso@335 | 463 </text> |
pankso@335 | 464 <entry> |
pankso@335 | 465 <input>. $CONFIG; echo $TERMINAL</input> |
pankso@335 | 466 <variable>TERMINAL</variable> |
pankso@335 | 467 </entry> |
pankso@335 | 468 <button> |
pankso@335 | 469 <label>Change</label> |
pankso@335 | 470 <input file icon="forward"></input> |
pankso@335 | 471 <action>sed -i s/"TERMINAL=.*"/"TERMINAL=\"$TERMINAL\""/ $CONFIG</action> |
pankso@335 | 472 </button> |
pankso@335 | 473 </hbox> |
pankso@335 | 474 <hbox> |
pankso@339 | 475 <text wrap="false"> |
pankso@339 | 476 <label>"Window manager:"</label> |
pankso@339 | 477 </text> |
pankso@339 | 478 <entry> |
pankso@339 | 479 <input>. $CONFIG; echo $WINDOW_MANAGER</input> |
pankso@339 | 480 <variable>WINDOW_MANAGER</variable> |
pankso@339 | 481 </entry> |
pankso@339 | 482 <button> |
pankso@339 | 483 <label>Change</label> |
pankso@339 | 484 <input file icon="forward"></input> |
pankso@339 | 485 <action>sed -i s/"WINDOW_MANAGER=.*"/"WINDOW_MANAGER=\"$WINDOW_MANAGER\""/ $CONFIG</action> |
pankso@339 | 486 </button> |
pankso@339 | 487 </hbox> |
pankso@339 | 488 <hbox> |
pankso@335 | 489 <button> |
pankso@335 | 490 <label>Exit</label> |
pankso@335 | 491 <input file icon="exit"></input> |
pankso@335 | 492 <action type="exit">exit</action> |
pankso@335 | 493 </button> |
pankso@335 | 494 </hbox> |
pankso@335 | 495 </vbox> |
pankso@335 | 496 </window>' ;; |
pankso@296 | 497 *_*) |
pankso@296 | 498 # Exec all function called by args (must have an underscore). |
pankso@296 | 499 $1 |
pankso@296 | 500 exit 0 ;; |
pankso@178 | 501 *) |
MikeDSmith25@252 | 502 # Usage if executed from cmdline. |
pankso@178 | 503 # |
pankso@178 | 504 usage |
pankso@178 | 505 exit 0 ;; |
pankso@178 | 506 esac |
pankso@178 | 507 |
pankso@178 | 508 gtkdialog --center --program=DESKTOP_DIALOG >/dev/null |
pankso@178 | 509 |
pankso@178 | 510 exit 0 |