Skip to content

Commit

Permalink
feat: [AM] adapt new AM
Browse files Browse the repository at this point in the history
open computer:/// trash:/// with xdg-open on V23, and gio open on UOS.

Log: as title.
  • Loading branch information
itsXuSt committed May 7, 2024
1 parent 6b553a4 commit a2255bd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions debian/dde-desktop.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
usr/bin/dde-desktop
usr/lib/*/dde-file-manager/plugins/desktop-core/*.so
usr/bin/dfm-open.sh
usr/share/applications/dde-computer.desktop
usr/share/applications/dde-trash.desktop
usr/share/applications/dde-home.desktop
Expand Down
1 change: 1 addition & 0 deletions src/apps/dde-desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(FILES data/com.deepin.dde.desktop.service DESTINATION share/dbus-1/services)

# computer and trash
install(FILES data/applications/dfm-open.sh DESTINATION bin/)
install(FILES data/applications/dde-computer.desktop DESTINATION share/applications/)
install(FILES data/applications/dde-trash.desktop DESTINATION share/applications/)
install(FILES data/applications/dde-home.desktop DESTINATION share/applications/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Categories=System;
Comment=Show basic info of the computer.
Exec=gio open computer:///
Exec=dfm-open.sh computer:///
GenericName=Computer
Icon=computer
Name=Computer
Expand Down
2 changes: 1 addition & 1 deletion src/apps/dde-desktop/data/applications/dde-trash.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Categories=System;
Comment=Open trash.
Exec=gio open trash:///
Exec=dfm-open.sh trash:///
GenericName=Open Trash.
Icon=user-trash
Name=Trash
Expand Down
13 changes: 13 additions & 0 deletions src/apps/dde-desktop/data/applications/dfm-open.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

sys_name=$(grep "^SystemName=" /etc/os-version | cut -d'=' -f2)
sys_ver=$(grep "^MajorVersion=" /etc/os-version | cut -d'=' -f2)

if [ "$sys_name" = "Deepin" ] && [ "$sys_ver" = "23" ]; then
echo "open $1 with xdg-open."
xdg-open $1
else
echo "open $1 with gio open."
gio open $1
fi

0 comments on commit a2255bd

Please sign in to comment.