Compare commits
1 Commits
33fd65eb2b
...
79b06bdc81
Author | SHA1 | Date |
---|---|---|
Abreu | 79b06bdc81 |
|
@ -59,4 +59,8 @@ For more information on how to schedule tasks using cron, consult this [video](h
|
|||
|
||||
## Dependencies
|
||||
|
||||
This plugin uses [unsplash_wallpaper](https://github.com/cuth/unsplash-wallpaper) by [cuth](https://github.com/cuth) to draw wallpapers. If you don't have it installed, you'll be prompted to install it upon the installation of this plugin.
|
||||
This plugin uses [unsplash_wallpaper](https://github.com/cuth/unsplash-wallpaper) by [cuth](https://github.com/cuth) to draw wallpapers. If you don't have it installed, you'll be prompted to install it upon the installation of this plugin.
|
||||
|
||||
---
|
||||
|
||||
Ⓐ Made in Anarchy. No wage slaves were economically coerced into the making of this work.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#! /usr/bin/fish
|
||||
#!/usr/bin/fish
|
||||
|
||||
# Load dependencies
|
||||
set -l cmd (command basename (status -f) | command cut -f 1 -d '.')
|
||||
set -l path (status filename | command xargs dirname)/../
|
||||
set -l path (status filename | command xargs dirname)/..
|
||||
source $path/dependency.fish \
|
||||
-n $cmd -N unsplash-wallpaper grep sed curl
|
||||
or exit 1
|
||||
|
@ -26,7 +26,7 @@ set -l flag (set --name | string match -r '(?<=^_flag_).{2,}')
|
|||
if string match -qr '^(add|remove|url)$' $flag
|
||||
if test -z "$argv"
|
||||
err "$cmd: Missing argument"
|
||||
source (command dirname (status -f))/../instructions.fish "$cmd -a/--\S+"
|
||||
source "$path/instructions.fish $cmd -a/--\S+"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
@ -40,7 +40,7 @@ end
|
|||
|
||||
switch "$flag"
|
||||
case help
|
||||
source -- "$path/instructions.fish $cmd -a/--\S+"
|
||||
source "$path/instructions.fish $cmd -a/--\S+"
|
||||
test -z "$argv"
|
||||
|
||||
case list
|
||||
|
@ -68,7 +68,7 @@ switch "$flag"
|
|||
case cache
|
||||
if string match -qvr '\d' $_flag_cache
|
||||
err "$cmd: $_flag_cache: Invalid value"
|
||||
source (command dirname (status -f))/../instructions.fish "$cmd -a/--\S+"
|
||||
source "$path/instructions.fish $cmd -a/--\S+"
|
||||
exit 1
|
||||
end
|
||||
set -U wallpaper_cache $_flag_cache
|
||||
|
@ -89,7 +89,7 @@ switch "$flag"
|
|||
if echo (math (count $argv) / 3) $argv[(command seq 2 3 (count $argv))] \
|
||||
| string match -qvr '\d'
|
||||
err "$cmd: Invalid syntax"
|
||||
source (command dirname (status -f))/../instructions.fish "$cmd -a/--\S+"
|
||||
source "$path/instructions.fish $cmd -a/--\S+"
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
@ -149,7 +149,7 @@ switch "$flag"
|
|||
# Retrieve wallpaper and, if possible, set it as the current wallpaper
|
||||
command mkdir -p $wallpapers_folder
|
||||
cd $wallpapers_folder
|
||||
command unsplash-wallpaper -o $argv 1>&2
|
||||
eval (command whereis unsplash-wallpaper | awk '{print $2}') -o $argv 1>&2
|
||||
or exit 1
|
||||
set wallpapers (ls -t | string match -ar '^wallpaper-.+\.jpe?g$')
|
||||
if type -qf gsettings
|
||||
|
@ -169,4 +169,4 @@ switch "$flag"
|
|||
test (count $wallpapers) -gt $wallpaper_cache
|
||||
and command rm $wallpapers[(math $wallpaper_cache + 1)..-1]
|
||||
prevd
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
install.fish
|
Loading…
Reference in New Issue