Compare commits

..

No commits in common. "5777bf2670ad9d5fb4b348815d20cc7c6b346a8e" and "729a0bb2033b82f24c84adaf776ad741452f040c" have entirely different histories.

2 changed files with 7 additions and 39 deletions

View file

@ -17,9 +17,8 @@ wayneko \- Neko on Wayland but with phases
.OP \-\-outline\-colour 0xRRGGBB[AA] .OP \-\-outline\-colour 0xRRGGBB[AA]
.OP \-\-type neko|inu|random .OP \-\-type neko|inu|random
.OP \-\-idle-sleep seconds .OP \-\-idle-sleep seconds
.OP \-\-sleep-phase seconds-seconds .OP \-\-phase-sleep seconds-seconds
.OP \-\-awake-phase seconds-seconds .OP \-\-phase-awake seconds-seconds
.OP \-\-currently awake|asleep|random
.OP \-\-layer background|bottom|top|overlay .OP \-\-layer background|bottom|top|overlay
.OP \-\-survive\-close .OP \-\-survive\-close
.YS .YS
@ -70,7 +69,7 @@ idle.
.RE .RE
. .
.P .P
\fB\-\-awake-phase\fR \fIseconds-seconds\fR \fB\-\-phase-awake\fR \fIseconds-seconds\fR
.RS .RS
Set the duration of how long neko will be awake at a time. Takes a minimum Set the duration of how long neko will be awake at a time. Takes a minimum
and a maximum amount of seconds, separated by a dash. Actual duration will and a maximum amount of seconds, separated by a dash. Actual duration will
@ -78,7 +77,7 @@ be drawn uniformly at random between the two values. Defaults to 120-600.
.RE .RE
. .
.P .P
\fB\-\-sleep-phase\fR \fIseconds-seconds\fR \fB\-\-phase-sleep\fR \fIseconds-seconds\fR
.RS .RS
Set the duration of how long neko will sleep at a time. Takes a minimum Set the duration of how long neko will sleep at a time. Takes a minimum
and a maximum amount of seconds, separated by a dash. Actual duration will and a maximum amount of seconds, separated by a dash. Actual duration will
@ -86,12 +85,6 @@ be drawn uniformly at random between the two values. Defaults to 450-1800.
.RE .RE
. .
.P .P
\fB\-\-currently\fR \fBawake\fR|\fBasleep\fR|\fBrandom\fR
.RS
Set whether neko is currenly (at startup) awake or asleep.
.RE
.
.P
\fB\-\-layer\fR \fBbackground\fR|\fBbottom\fR|\fBtop\fR|\fBoverlay\fR \fB\-\-layer\fR \fBbackground\fR|\fBbottom\fR|\fBtop\fR|\fBoverlay\fR
.RS .RS
Set the layer for the surface. Set the layer for the surface.

View file

@ -32,10 +32,9 @@ const char usage[] =
" --background-colour 0xRRGGBB[AA]\n" " --background-colour 0xRRGGBB[AA]\n"
" --outline-colour 0xRRGGBB[AA]\n" " --outline-colour 0xRRGGBB[AA]\n"
" --type neko|inu|random\n" " --type neko|inu|random\n"
" --idle-sleep seconds\n" " --idle-sleep num\n"
" --sleep-phase seconds-seconds\n" " --phase-sleep num-num\n"
" --awake-phase seconds-seconds\n" " --phase-awake num-num\n"
" --currently awake|asleep|random\n"
" --layer background|bottom|top|overlay\n" " --layer background|bottom|top|overlay\n"
" --survive-close\n" " --survive-close\n"
"\n"; "\n";
@ -1441,7 +1440,6 @@ int main (int argc, char *argv[])
{ {
char* a = get_argument(argc, argv, &i); char* a = get_argument(argc, argv, &i);
char* b = a; char* b = a;
if (a == NULL) return EXIT_FAILURE;
while (*b != '-' && *b != 0) b++; while (*b != '-' && *b != 0) b++;
if (*b == 0) { if (*b == 0) {
@ -1465,7 +1463,6 @@ int main (int argc, char *argv[])
{ {
char* a = get_argument(argc, argv, &i); char* a = get_argument(argc, argv, &i);
char* b = a; char* b = a;
if (a == NULL) return EXIT_FAILURE;
while (*b != '-' && *b != 0) b++; while (*b != '-' && *b != 0) b++;
if (*b == 0) { if (*b == 0) {
@ -1485,28 +1482,6 @@ int main (int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }
else if ( strcmp(argv[i], "--currently") == 0 )
{
const char *t = get_argument(argc, argv, &i);
if ( t == NULL )
return EXIT_FAILURE;
/* yes, the phases are swapped because the first thing that will happen is a phase change */
if ( strcmp(t, "awake") == 0 )
current_phase = PHASE_SLEEP;
else if ( strcmp(t, "asleep") == 0 )
current_phase = PHASE_AWAKE;
else if ( strcmp(t, "random") == 0 )
current_phase = rand() % 2 == 0 ? PHASE_SLEEP : PHASE_AWAKE;
else
{
fprintf(stderr, "ERROR: Unknown argument '%s' for flag '--currently'.\n", t);
return EXIT_FAILURE;
}
if (current_phase == PHASE_AWAKE)
current_neko = NEKO_SLEEP_1;
}
else else
{ {
fprintf(stderr, "ERROR: Unknown option: %s\n", argv[i]); fprintf(stderr, "ERROR: Unknown option: %s\n", argv[i]);