Change values using xmlstarlet.
This commit is contained in:
parent
d4094e4884
commit
5cd5b3f8ef
|
|
@ -3,6 +3,8 @@
|
||||||
apt-get -y install rox-filer
|
apt-get -y install rox-filer
|
||||||
apt-get -y install xmlstarlet
|
apt-get -y install xmlstarlet
|
||||||
|
|
||||||
|
# Make changes to Options, menus2 using xmlstarlet at the bottom of this script.
|
||||||
|
|
||||||
DEST=/etc/skel
|
DEST=/etc/skel
|
||||||
ROXFILER_HOME=${DEST}/.config/rox.sourceforce.net
|
ROXFILER_HOME=${DEST}/.config/rox.sourceforce.net
|
||||||
MIMETYPES=${ROXFILER_HOME}/MIME-types
|
MIMETYPES=${ROXFILER_HOME}/MIME-types
|
||||||
|
|
@ -14,74 +16,92 @@ cat > $MIMETYPES/application_msword <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec libreoffice "$@"
|
exec libreoffice "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_pdf <<EOF
|
cat > $MIMETYPES/application_pdf <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec atril "$@"
|
exec atril "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_vnd.openxmlformats-officedocument.spreadsheetml.sheet <<EOF
|
cat > $MIMETYPES/application_vnd.openxmlformats-officedocument.spreadsheetml.sheet <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec libreoffice "$@"
|
exec libreoffice "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_vnd.openxmlformats-officedocument.wordprocessingml.document <<EOF
|
cat > $MIMETYPES/application_vnd.openxmlformats-officedocument.wordprocessingml.document <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec libreoffice "$@"
|
exec libreoffice "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_vnd.rar <<EOF
|
cat > $MIMETYPES/application_vnd.rar <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec xarchiver "$@"
|
exec xarchiver "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_x-kicad-pcb <<EOF
|
cat > $MIMETYPES/application_x-kicad-pcb <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec kicad "$@"
|
exec kicad "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_x-kicad-project <<EOF
|
cat > $MIMETYPES/application_x-kicad-project <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec kicad "$@"
|
exec kicad "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/application_zip <<EOF
|
cat > $MIMETYPES/application_zip <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec xarchiver "$@"
|
exec xarchiver "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/audio_mp4 <<EOF
|
cat > $MIMETYPES/audio_mp4 <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/audio_mpeg <<EOF
|
cat > $MIMETYPES/audio_mpeg <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/audio_x-m4b <<EOF
|
cat > $MIMETYPES/audio_x-m4b <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/image_jpeg <<EOF
|
cat > $MIMETYPES/image_jpeg <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec geeqie "$@"
|
exec geeqie "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/image_png <<EOF
|
cat > $MIMETYPES/image_png <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec geeqie "$@"
|
exec geeqie "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/text_x-csrc <<EOF
|
cat > $MIMETYPES/text_x-csrc <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec /opt/arduino/arduino-1.8.10 "$@"
|
exec /opt/arduino/arduino-1.8.10 "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/video_mp4 <<EOF
|
cat > $MIMETYPES/video_mp4 <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/video_webm <<EOF
|
cat > $MIMETYPES/video_webm <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/video_x-matroska <<EOF
|
cat > $MIMETYPES/video_x-matroska <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/video_x-ms-wmv <<EOF
|
cat > $MIMETYPES/video_x-ms-wmv <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > $MIMETYPES/video_x-msvideo <<EOF
|
cat > $MIMETYPES/video_x-msvideo <<EOF
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
exec mpv --force-window "$@"
|
exec mpv --force-window "$@"
|
||||||
|
|
@ -90,6 +110,22 @@ EOF
|
||||||
# Options
|
# Options
|
||||||
# The Options and menus2 file are not created until first run
|
# The Options and menus2 file are not created until first run
|
||||||
|
|
||||||
|
#
|
||||||
|
cat > ${ROXFILER_HOME}/ROX-Filer/Bookmarks.xml <<'EOF'
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<bookmarks>
|
||||||
|
<bookmark title="/opt/tor-browser_en-US/Browser/Downloads">/opt/tor-browser_en-US/Browser/Downloads</bookmark>
|
||||||
|
</bookmarks>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
cat > ${ROXFILER_HOME}/ROX-Filer/Bookmarks.xml <<'EOF'
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<groups>
|
||||||
|
<group name="1"><directory>/var/tmp</directory></group>
|
||||||
|
</groups>
|
||||||
|
EOF
|
||||||
|
|
||||||
cat > ${ROXFILER_HOME}/ROX-Filer/Options <<'EOF'
|
cat > ${ROXFILER_HOME}/ROX-Filer/Options <<'EOF'
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<Options>
|
<Options>
|
||||||
|
|
@ -263,7 +299,12 @@ cat > ${ROXFILER_HOME}/ROX-Filer/menus2 <<'EOF'
|
||||||
; (gtk_accel_path "<filer>/File/Count" "")
|
; (gtk_accel_path "<filer>/File/Count" "")
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
xmlstarlet edit -L -u "/Options/Option[@name='display_inherit_options']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
# Changes display_dir_colour from #000080 to #3399FF e17 blue
|
||||||
|
xmlstarlet edit -L -u "/Options/Option[@name='display_dir_colour']" -v '#3399FF' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
xmlstarlet edit -L -u "/Options/Option[@name='display_dirs_first']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
xmlstarlet edit -L -u "/Options/Option[@name='display_dirs_first']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
|
xmlstarlet edit -L -u "/Options/Option[@name='display_inherit_options']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
|
|
||||||
xmlstarlet edit -L -u "/Options/Option[@name='filer_view_type']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
xmlstarlet edit -L -u "/Options/Option[@name='filer_view_type']" -v '1' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
xmlstarlet edit -L -u "/Options/Option[@name='menu_xterm']" -v 'xfce4-terminal' ${ROXFILER_HOME}/ROX-Filer/Options
|
xmlstarlet edit -L -u "/Options/Option[@name='menu_xterm']" -v 'terminology' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
|
xmlstarlet edit -L -u "/Options/Option[@name='dnd_uri_handler']" -v 'x-terminal-emulator -e wget -c $1' ${ROXFILER_HOME}/ROX-Filer/Options
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue