summarylogtreecommitdiffstats
path: root/fake_dde-file-manager
blob: d26073d0b7404b340905eac73a224297f2827287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# 7Ji: Adapted from Kimiblock's https://aur.archlinux.org/cgit/aur.git/tree/open.sh?h=wechat-uos-bwrap , thanks :)

_show_item=''
_item=''
for _arg in "$@"; do
    if [[ "${_arg}" == --show-item ]]; then
        _show_item='y'
    else
        [[ -z "${_item}" ]] && _item="${_arg}"
    fi
done

if [[ "${_show_item}" ]]; then
    echo "Fake deepin file manager: xdg-open to show '${_item}' in file manager"
    exec xdg-open $(dirname -- "${_item}")
fi

echo "Fake deepin file manager: xdg-open with args $@"
exec xdg-open "$@"