Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wslview.desktop #143

Merged
merged 3 commits into from
Aug 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sudo make res_install
```
wslu
|-src
| |-applications
| | \- wslview.desktop: XDG-style app definition for wslview
| |-etc
| | |-wsl.ico: legacy default icon for wslusc
| | |-wsl-gui.ico: default icon for wslusc GUI shortcut
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ uninstall:
done
rm -rf $(DESTDIR)$(PREFIX)/share/man/man7/wslu.7.gz
rm -rf $(DESTDIR)$(PREFIX)/share/wslu
rm -rf $(DESTDIR)$(PREFIX)/share/applications/wslview.desktop

doc:
[ -d $(OUTMANPATH) ] || mkdir $(OUTMANPATH)
Expand All @@ -59,6 +60,7 @@ res_install:
install -Dm 644 src/etc/*.ps1 -t $(DESTDIR)$(PREFIX)/share/wslu
install -Dm 644 src/etc/*.ico -t $(DESTDIR)$(PREFIX)/share/wslu
install -Dm 755 src/etc/*.sh -t $(DESTDIR)$(PREFIX)/share/wslu
install -Dm 644 src/applications/*.desktop $(DESTDIR)$(PREFIX)/share/applications

clean:
rm -rf $(OUTPATH)
Expand Down
2 changes: 1 addition & 1 deletion extras/build/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Vcs-Git: https://github.com/wslutilities/wslu.git

Package: wslu
Architecture: all
Depends: bc, imagemagick
Depends: bc, imagemagick desktop-file-utils
Description: A collection of utilities for Windows 10 Linux Subsystem
This is a collection of utilities for Windows 10 Linux Subsystem, such as converting WSL path to Windows path or creating your favorite linux app shortcuts on Windows 10 Desktop. Requires Windows 10 Creators Update and higher.
2 changes: 2 additions & 0 deletions extras/build/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] ; then
update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/wslview 30
update-alternatives --install /usr/bin/www-browser www-browser /usr/bin/wslview 30
fi

update-desktop-database
6 changes: 5 additions & 1 deletion extras/build/rpm/wslu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Version: BUILDVERPLACEHOLDER
Release: RELVERPLACEHOLDER
Source: wslu-BUILDVERPLACEHOLDER.tar.gz
BuildArch: noarch
Requires: bc ImageMagick
Requires: bc ImageMagick desktop-file-utils
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -26,6 +26,7 @@ make
mkdir -p %{?buildroot}/usr/share/man/man1/
mkdir -p %{?buildroot}/usr/share/man/man7/
mkdir -p %{?buildroot}/usr/share/wslu/
mkdir -p %{?buildroot}/usr/share/applications/
mkdir -p %{?buildroot}/usr/bin/
# normal part
make PREFIX=/usr DESTDIR=%{?buildroot} install
Expand All @@ -39,10 +40,12 @@ ln -sf /usr/share/man/man1/wslview.1.gz %{?buildroot}/usr/share/man/man1/wstart.
%post
%{_sbindir}/update-alternatives --install %{_bindir}/www-browser www-browser %{_bindir}/wslview 1
%{_sbindir}/update-alternatives --install %{_bindir}/x-www-browser x-www-browser %{_bindir}/wslview 1
%{_bindir}/update-desktop-database

%postun
%{_sbindir}/update-alternatives --remove www-browser %{_bindir}/wslview
%{_sbindir}/update-alternatives --remove x-www-browser %{_bindir}/wslview
%{_bindir}/update-desktop-database

%clean
rm -rf $RPM_BUILD_ROOT
Expand All @@ -60,6 +63,7 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/wslact
%{_bindir}/wslvar
/usr/share/wslu/
/usr/share/applications/wslview.desktop
%doc /usr/share/man/

%changelog
Expand Down
1 change: 1 addition & 0 deletions extras/scripts/wslu-install
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ bash configure.sh
make
sudo make install
sudo install -m755 extras/scripts/wslu-uninstall /usr/bin
sudo update-desktop-database
rm -rf $BUILD_DIR
echo -e "\e[32m## wslu installation complete. To uninstall, run 'wslu-uninstall'\033(B\033[m"
2 changes: 2 additions & 0 deletions extras/scripts/wslu-uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ done

sudo rm -f /usr/share/man/man7/wsl*
sudo rm -rf /usr/share/wslu
sudo rm -rf /usr/share/applications/wslview.desktop
sudo update-desktop-database
echo -e "\e[32m## wslu uninstallation complete.\033(B\033[m"
9 changes: 9 additions & 0 deletions src/applications/wslview.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=WSLView
Comment=Open files and addresses in Windows
Icon=windows
Exec=/usr/bin/wslview %U
Terminal=false
Type=Application
Categories=Utility;
MimeTypes=x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/file