Add recents file for sofi.sh
This commit is contained in:
parent
ead75bbffd
commit
658e5043e1
|
@ -73,6 +73,21 @@ apps() {
|
||||||
read_snap_apps
|
read_snap_apps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RECENTS="$HOME/.sofi-recent"
|
||||||
|
|
||||||
|
recent() {
|
||||||
|
test -f "$RECENTS" && cat "$RECENTS"
|
||||||
|
}
|
||||||
|
|
||||||
|
add-recent() {
|
||||||
|
if grep "$1" "$RECENTS"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "$1" >> "$RECENTS"
|
||||||
|
tail -n 10 "$RECENTS" > "$RECENTS.temp"
|
||||||
|
mv "$RECENTS.temp" "$RECENTS"
|
||||||
|
}
|
||||||
|
|
||||||
open_app() {
|
open_app() {
|
||||||
app="$(echo "$1" | cut -c 5-)"
|
app="$(echo "$1" | cut -c 5-)"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
@ -111,6 +126,7 @@ if [[ "$1" == "--print-only" ]]; then
|
||||||
fi
|
fi
|
||||||
if [[ "$1" == "" ]]; then
|
if [[ "$1" == "" ]]; then
|
||||||
choice="$(cat \
|
choice="$(cat \
|
||||||
|
<(recent) \
|
||||||
<(system_info) \
|
<(system_info) \
|
||||||
<(windows) \
|
<(windows) \
|
||||||
<($HOME/.rofi-list-git-repos.py --no-icon) \
|
<($HOME/.rofi-list-git-repos.py --no-icon) \
|
||||||
|
@ -147,6 +163,8 @@ npm_handler() {
|
||||||
setsid xdg-open "https://npmjs.com/package/$package" &> /dev/null &
|
setsid xdg-open "https://npmjs.com/package/$package" &> /dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add-recent "$choice"
|
||||||
|
|
||||||
case $choice in
|
case $choice in
|
||||||
git*)
|
git*)
|
||||||
setsid "$HOME/.rofi-list-git-repos.py" "$choice" &> /dev/null &
|
setsid "$HOME/.rofi-list-git-repos.py" "$choice" &> /dev/null &
|
||||||
|
|
Loading…
Reference in New Issue