comparison packaging/linux-installer.inc.in @ 785:2fb539d4b1ff

Simply autostart creation by initializing the path in init_vars
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 14 Jul 2014 13:21:17 +0200
parents ca149bad8195
children 3a9b0c75f5a6
comparison
equal deleted inserted replaced
784:d92264e9e08f 785:2fb539d4b1ff
137 { 137 {
138 if [ $SYSINST -eq 1 ] ; then 138 if [ $SYSINST -eq 1 ] ; then
139 inst_default_prefix="$SYSDEFAULT_PREFIX" 139 inst_default_prefix="$SYSDEFAULT_PREFIX"
140 instcfg_path="${SYSCFGPATH}" 140 instcfg_path="${SYSCFGPATH}"
141 instdata_path="${SYSDATAPATH}" 141 instdata_path="${SYSDATAPATH}"
142 autostart_path="$(getent passwd "${SUDO_USER}" | cut -d ':' -f 6)/.config/autostart"
142 else 143 else
143 inst_default_prefix="$DEFAULT_PREFIX" 144 inst_default_prefix="$DEFAULT_PREFIX"
144 instcfg_path="${CFGPATH}" 145 instcfg_path="${CFGPATH}"
145 instdata_path="${DATAPATH}" 146 instdata_path="${DATAPATH}"
147 autostart_path=${XDG_CONFIG_HOME:-~/.config/autostart}
146 fi 148 fi
147 instcfg_file="${instcfg_path}/${INSTCFGNAME}" 149 instcfg_file="${instcfg_path}/${INSTCFGNAME}"
148 } 150 }
149 151
150 write_instcfg() 152 write_instcfg()
265 echo "Removing configuration files:" 267 echo "Removing configuration files:"
266 rm_files "${tbcfg_files[@]}" 268 rm_files "${tbcfg_files[@]}"
267 rm_empty_dirs "$instcfg_path" 269 rm_empty_dirs "$instcfg_path"
268 270
269 echo "Removing TrustBridge from autostart" 271 echo "Removing TrustBridge from autostart"
270 if [ "${SUDO_USER+X}" ] ; then 272 rm_files "${autostart_path}/tustbridge.desktop"
271 homedir=$(getent passwd "${SUDO_USER}" | cut -d ':' -f 6)
272 rm_files "${homedir}/.config/autostart/tustbridge.desktop"
273 else
274 config_home=${XDG_CONFIG_HOME:-~/.config}
275 rm_files "${config_home}/autostart/tustbridge.desktop"
276 fi
277 } 273 }
278 274
279 deinstall() 275 deinstall()
280 { 276 {
281 if [ "${oldinstcfg[PREFIX]}" ] ; then 277 if [ "${oldinstcfg[PREFIX]}" ] ; then
310 } 306 }
311 307
312 setup_autostart() 308 setup_autostart()
313 { 309 {
314 # Supported desktop environments: Unity, GNOME, XFCE, LXDE, KDE 310 # Supported desktop environments: Unity, GNOME, XFCE, LXDE, KDE
315 311 # System wide installation with a nonstandard XDG_CONFIG_HOME or KDEHOME is not
316 if [ $SYSINST -eq 1 -a "${SUDO_USER+X}" ] ; then 312 # respected with regards to autostart.
317 homedir=$(getent passwd "${SUDO_USER}" | cut -d ':' -f 6) 313 if [ ! -d "${autostart_path}" ]; then
318 install -d "${instcfg[PREFIX]}" || fatal "Could not create '${instcfg[PREFIX]}'!" 314 install -d "${autostart_path}" || \
319 if [ ! -d "${homedir}/.config/autostart/" ]; then 315 fatal "Failed to create autostart directory: '${autostart_path}'"
320 install -d "${homedir}/.config/autostart/" || \ 316 fi
321 fatal "Failed to create autostart directory: '${homedir}/.config/autostart/'" 317
322 fi 318 write_autostart "${autostart_path}/tustbridge.desktop"
323 write_autostart "${homedir}/.config/autostart/tustbridge.desktop"
324 # System wide installation with a nonstandard XDG_CONFIG_HOME or KDEHOME is not
325 # respected with regards to autostart.
326 else
327 config_home=${XDG_CONFIG_HOME:-~/.config}
328 if [ ! -d "${config_home}/autostart" ]; then
329 install -d "${config_home}/autostart" || \
330 fatal "Failed to create autostart directory: '${config_home}/autostart'"
331 fi
332 write_autostart "${config_home}/autostart/tustbridge.desktop"
333 fi
334 } 319 }
335 320
336 #====================================================================== 321 #======================================================================
337 # main() 322 # main()
338 323

http://wald.intevation.org/projects/trustbridge/