From 618c755a254cde746626a1eac77fe823e0f93e4d Mon Sep 17 00:00:00 2001 From: haemka Date: Mon, 23 Aug 2021 08:55:00 +0200 Subject: [PATCH] diasble debug for remoteoffice, added test editor and file manager to sanemime --- remoteoffice.sh | 2 -- sanemime.sh | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/remoteoffice.sh b/remoteoffice.sh index 912a86f..7054993 100755 --- a/remoteoffice.sh +++ b/remoteoffice.sh @@ -1,7 +1,5 @@ #!/bin/sh -set -x - # VPN NMCONN="49088a1e-18c2-48aa-a664-f212eb83a727" # RDP diff --git a/sanemime.sh b/sanemime.sh index 1f987fd..ba09895 100755 --- a/sanemime.sh +++ b/sanemime.sh @@ -12,11 +12,13 @@ cp ${HOME}/.config/mimeapps.list ${HOME}/.config/mimeapps.list.bak BROWSER=/usr/share/applications/firefox.desktop EMAIL=${HOME}/.local/share/applications/neomutt.desktop -#IMAGE_VIEWER=/usr/share/applications/feh.desktop IMAGE_VIEWER=/usr/share/applications/sxiv.desktop VIDEO_VIEWER=/usr/share/applications/mpv.desktop PDF_VIEWER=/usr/share/applications/org.pwmt.zathura-pdf-mupdf.desktop +FILE_MANAGER=/usr/share/applications/thunar.desktop +TEXT_EDITOR=/usr/share/applications/leafpad.desktop + MSTEAMS=${HOME}/.local/share/applications/teams.desktop TS3=${HOME}/.local/share/applications/teamspeak.desktop ZOOM=${HOME}/.local/share/applications/zoom.desktop @@ -37,6 +39,24 @@ for type in ${types[@]}; do xdg-mime default $(basename ${EMAIL}) ${type} done +# Set default file manager +FILE_MANAGER_NAME=$(awk -F= '/^Name=/ {print $2;exit;}' ${FILE_MANAGER}) +IFS=';' read -ra types <<< $(awk -F= '/MimeType/ {print $2}' ${FILE_MANAGER}) +for type in ${types[@]}; do + echo "Setting ${type} to ${FILE_MANAGER_NAME}" + xdg-mime default $(basename ${FILE_MANAGER}) ${type} +done + +# Set default text editor +TEXT_EDITOR_NAME=$(awk -F= '/^Name=/ {print $2;exit;}' ${TEXT_EDITOR}) +IFS=';' read -ra types <<< $(awk -F= '/MimeType/ {print $2}' ${TEXT_EDITOR}) +for type in ${types[@]}; do + if [[ ${type} =~ ^text.*$ ]]; then + echo "Setting ${type} to ${TEXT_EDITOR_NAME}" + xdg-mime default $(basename ${TEXT_EDITOR}) ${type} + fi +done + # Set default image viewer IMAGE_VIEWER_NAME=$(awk -F= '/^Name=/ {print $2;exit;}' ${IMAGE_VIEWER}) IFS=';' read -ra types <<< $(awk -F= '/MimeType/ {print $2}' ${IMAGE_VIEWER})