Add support for *.code-workspace mimetype
Support for opening *.code-workspace files in visual-studio-code on Linux was added in https://github.com/microsoft/vscode/pull/95637. However, it only supports deb and rpm files. This commit adds appropriate files to register *.code-workspace as a separate mimetype and opens them in visual-studio-code.
This commit is contained in:
committed by
D. Can Celasun
parent
87c8c9f21e
commit
afe6b74c97
17
PKGBUILD
17
PKGBUILD
@@ -3,7 +3,7 @@
|
|||||||
pkgname=visual-studio-code-bin
|
pkgname=visual-studio-code-bin
|
||||||
_pkgname=visual-studio-code
|
_pkgname=visual-studio-code
|
||||||
pkgver=1.54.3
|
pkgver=1.54.3
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)"
|
pkgdesc="Visual Studio Code (vscode): Editor for building and debugging modern web and cloud applications (official binary version)"
|
||||||
arch=('x86_64' 'i686' 'aarch64' 'armv7h')
|
arch=('x86_64' 'i686' 'aarch64' 'armv7h')
|
||||||
url="https://code.visualstudio.com/"
|
url="https://code.visualstudio.com/"
|
||||||
@@ -14,7 +14,7 @@ conflicts=('code')
|
|||||||
depends=(libxkbfile gnupg gtk3 libsecret nss gcc-libs libnotify libxss glibc lsof)
|
depends=(libxkbfile gnupg gtk3 libsecret nss gcc-libs libnotify libxss glibc lsof)
|
||||||
optdepends=('glib2: Needed for move to trash functionality'
|
optdepends=('glib2: Needed for move to trash functionality'
|
||||||
'libdbusmenu-glib: Needed for KDE global menu')
|
'libdbusmenu-glib: Needed for KDE global menu')
|
||||||
source=(${_pkgname}.desktop ${_pkgname}-url-handler.desktop)
|
source=(${_pkgname}.desktop ${_pkgname}-url-handler.desktop ${_pkgname}-workspace.xml)
|
||||||
source_x86_64=(code_x64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-x64/stable)
|
source_x86_64=(code_x64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-x64/stable)
|
||||||
source_aarch64=(code_arm64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-arm64/stable)
|
source_aarch64=(code_arm64_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-arm64/stable)
|
||||||
source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-armhf/stable)
|
source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com/${pkgver}/linux-armhf/stable)
|
||||||
@@ -22,8 +22,9 @@ source_armv7h=(code_armhf_${pkgver}.tar.gz::https://update.code.visualstudio.com
|
|||||||
# i686 uses "latest" instead of a specific version as it's not always updated in a timely manner
|
# i686 uses "latest" instead of a specific version as it's not always updated in a timely manner
|
||||||
source_i686=(code_ia32_${pkgver}.tar.gz::https://update.code.visualstudio.com/latest/linux-ia32/stable)
|
source_i686=(code_ia32_${pkgver}.tar.gz::https://update.code.visualstudio.com/latest/linux-ia32/stable)
|
||||||
# This generates cleaner checksums
|
# This generates cleaner checksums
|
||||||
sha256sums=('0deefcb638e06c35a52e7e9fb8e19b2dc393f01e5c1c122d2938cddeb22cf8de'
|
sha256sums=('fcb68f31ab791e0ae126c09e01f28fb428fbbbb7cc36c07dcd595d9562c22e96'
|
||||||
'be3d123aacd575d8f836728266eb421ea70399d713d1fc30378dbc5602b519fb')
|
'be3d123aacd575d8f836728266eb421ea70399d713d1fc30378dbc5602b519fb'
|
||||||
|
'24ba09a6398c9781ed7cb6f1a9f6f38ec204899ba1f33db92638bf6d3cb0aed6')
|
||||||
sha256sums_x86_64=('7321623f71206f0b06e658ec19573a427949cd05ba409456e6c3c303d01aea3a')
|
sha256sums_x86_64=('7321623f71206f0b06e658ec19573a427949cd05ba409456e6c3c303d01aea3a')
|
||||||
sha256sums_i686=('64360439cc2fa596838062f7e6f9757b79d4b775a564f18bad6cbad154bf850c')
|
sha256sums_i686=('64360439cc2fa596838062f7e6f9757b79d4b775a564f18bad6cbad154bf850c')
|
||||||
sha256sums_aarch64=('4ce8c38ba12678a8e0e9236976c73ccfb8dd00063f78e5198f1c56e52bc39913')
|
sha256sums_aarch64=('4ce8c38ba12678a8e0e9236976c73ccfb8dd00063f78e5198f1c56e52bc39913')
|
||||||
@@ -47,12 +48,20 @@ package() {
|
|||||||
install -d "${pkgdir}/usr/bin"
|
install -d "${pkgdir}/usr/bin"
|
||||||
install -d "${pkgdir}/usr/share/applications"
|
install -d "${pkgdir}/usr/share/applications"
|
||||||
install -d "${pkgdir}/usr/share/icons"
|
install -d "${pkgdir}/usr/share/icons"
|
||||||
|
install -d "${pkgdir}/usr/share/mime/packages"
|
||||||
|
|
||||||
install -m644 "${srcdir}/${_pkg}/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf"
|
install -m644 "${srcdir}/${_pkg}/resources/app/LICENSE.rtf" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.rtf"
|
||||||
install -m644 "${srcdir}/${_pkg}/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/icons/${_pkgname}.png"
|
install -m644 "${srcdir}/${_pkg}/resources/app/resources/linux/code.png" "${pkgdir}/usr/share/icons/${_pkgname}.png"
|
||||||
install -m644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
|
install -m644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
|
||||||
install -m644 "${srcdir}/${_pkgname}-url-handler.desktop" "${pkgdir}/usr/share/applications/${_pkgname}-url-handler.desktop"
|
install -m644 "${srcdir}/${_pkgname}-url-handler.desktop" "${pkgdir}/usr/share/applications/${_pkgname}-url-handler.desktop"
|
||||||
|
install -m644 "${srcdir}/${_pkgname}-workspace.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}-workspace.xml"
|
||||||
|
|
||||||
cp -r "${srcdir}/${_pkg}/"* "${pkgdir}/opt/${_pkgname}" -R
|
cp -r "${srcdir}/${_pkg}/"* "${pkgdir}/opt/${_pkgname}" -R
|
||||||
ln -s /opt/${_pkgname}/bin/code "${pkgdir}"/usr/bin/code
|
ln -s /opt/${_pkgname}/bin/code "${pkgdir}"/usr/bin/code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
if hash update-mime-database 2>/dev/null; then
|
||||||
|
update-mime-database /usr/share/mime
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
7
visual-studio-code-workspace.xml
Normal file
7
visual-studio-code-workspace.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
|
<mime-type type="application/x-visual-studio-code-workspace">
|
||||||
|
<comment>Visual Studio Code Workspace</comment>
|
||||||
|
<glob pattern="*.code-workspace"/>
|
||||||
|
</mime-type>
|
||||||
|
</mime-info>
|
||||||
@@ -8,7 +8,7 @@ Type=Application
|
|||||||
StartupNotify=false
|
StartupNotify=false
|
||||||
StartupWMClass=code
|
StartupWMClass=code
|
||||||
Categories=Utility;TextEditor;Development;IDE;
|
Categories=Utility;TextEditor;Development;IDE;
|
||||||
MimeType=text/plain;inode/directory;
|
MimeType=text/plain;inode/directory;application/x-visual-studio-code-workspace;
|
||||||
Actions=new-empty-window;
|
Actions=new-empty-window;
|
||||||
Keywords=vscode;
|
Keywords=vscode;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user