summaryrefslogtreecommitdiff
path: root/via-feed
blob: af78b17d1c005aec112a1d03902f1a0af82f6730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

cache="$HOME/.cache/via"

if [[ $1 == "-r" ]] || [[ ! -e $cache ]]; then
	cat "$HOME/.config/via/shortcuts" >"$cache"
	cat "$HOME/.config/via/websites" >>"$cache"
	find "$HOME" -mindepth 1 \
		\( \
		-type d -name ".*" ! -path "$HOME/.scripts" \
		-o -path "$HOME/cell" \
		-o -path "$HOME/phone/*" \
		\) -prune \
		-o -print |
		sort >>"$cache"
	# notify-send "via cache updated."
fi

if [ "$CRON" = "1" ]; then
	exit 0
else
	wmctrl -xl | sed "s/^[^.]*\.//;s/ \+\S\+ \+/ /;s/^/w /;s/ \+/ /g"
	cat "$cache"
fi