about summary refs log tree commit diff stats
path: root/README
blob: 54ca4ace9598af1023f5634aeab588cc00ba7e45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
                               _________

                                  CRUX

                                Andinus
                               _________


Table of Contents
_________________

1 Documentation
.. 1.1 Options
..... 1.1.1 Crux
..... 1.1.2 Unsplash Source
.. 1.2 Dependencies
.. 1.3 Cross-platform compatibility


Crux is a wallpaper manager written in Perl, currently it supports
fetching from Unsplash Source.

I have previously written [Cetus] which supports /Bing Photo of the Day/
& /NASA Astronomy Picture of the Day/. I plan to port all to features to
Crux someday.

*Tested on*:
- OpenBSD 6.7
  - Perl v5.30


[Cetus] https://andinus.nand.sh/cetus/


1 Documentation
===============

1.1 Options
~~~~~~~~~~~

1.1.1 Crux
----------

* 1.1.1.1 debug

  This will print additional information that'll help you to debug the
  code. You might see multiple Unveil warnings on non-OpenBSD systems,
  ignore them.

  $response received from the api will also be printed.


* 1.1.1.2 help

  Prints quick help information listing all the options & a small
  description.


1.1.2 Unsplash Source
---------------------

  Some options cannot be mixed, if you mix them then expect unexpected
  results. It won't fail but can return photos that you didn't ask for.

  For example, `--search nature --user test' - You might think this will
  return an image from user "test" & related to "nature" but it won't!
  It will either return an image related to "nature" or user "test"
  because these options cannot be mixed. Look at [Unsplash Source] to
  know more about the kind of queries that are valid.

  I could write a check for invalid options but that would be
  complicated so I didn't, it's easier to ignore invalid options & you
  can always pass the `debug' option to see what query it constructed.

  `--search nature --daily' - This is a valid set, I have written about
  valid sets below, like under `daily' it's mentioned that you can pass
  `search' option so read each description.


[Unsplash Source] https://source.unsplash.com

* 1.1.2.1 resolution

  Default is "1920x1080", it doesn't check the value passed so make sure
  you pass the correct value. This can be passed with any option, it
  will be ignored if not applicable.


* 1.1.2.2 search

  Search accepts multiple space seperated values. It's passed directly
  to the api.

  *Note*: The feature to get space seperated values is marked as
  experimental in Getopt::Long so the behaviour can change in future,
  worse even get removed. To guarantee backwards compatibility pass each
  value by itself like `--search rocky --search mountain', this is
  equivalent to `--search rocky mountain'.


* 1.1.2.3 featured

  Only Unsplash curated images are returned if you pass `featured', this
  can be passed along with `search'.


* 1.1.2.4 user

  This will return a random photo from given user.


* 1.1.2.5 userlikes

  Only returns random photo from user's likes, this is a boolean & can
  be passed with `user' option.


* 1.1.2.6 collection

  Returns photos from a collection.


* 1.1.2.7 daily, weekly

  This will return a set random daily or weekly image. `user' & `search'
  option can be passed to narrow the selection.


1.2 Dependencies
~~~~~~~~~~~~~~~~

  The version numbers mentioned in cpanfile is not the minimum required
  to run Crux, you can try lowering them. Might also make this work
  without some dependencies, look at `lib/' and see what dependencies
  you can remove.

  For example, you can probably remove Carp & replace it with `die', not
  the same thing but it should work.

  *Note*: Do this only if you can't install those dependencies for some
   reason.


1.3 Cross-platform compatibility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Crux should run on all supported platforms, there is OpenBSD specific
  code but it's ignored on other platforms. To know more about how this
  works read this page: [Cross-platform compatibility].


[Cross-platform compatibility]
https://andinus.nand.sh/projects/cross-platform-compatibility.html