Skip to content

Commit

Permalink
Add status
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jun 12, 2024
1 parent a0f3b14 commit a07fcb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions extra/swayimgrc.5
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Valid actions:
.IP "\fBantialiasing\fR: switch antialiasing (bicubic interpolation);"
.IP "\fBinfo\fR \fI[MODE]\fR: switch text info mode or set specified one (\fIoff\fR/\fIbrief\fR/\fIfull\fR);"
.IP "\fBexec\fR \fICOMMAND\fR: execute an external command, use % to substitute the path to the current image, %% to escape %;"
.IP "\fBstatus\fR \fITEXT\fR: print message in the status field;"
.IP "\fBexit\fR: exit the application."
.\" ****************************************************************************
.\" Mouse / touchpad config section
Expand Down
1 change: 1 addition & 0 deletions src/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static const char* action_names[] = {
[action_antialiasing] = "antialiasing",
[action_info] = "info",
[action_exec] = "exec",
[action_status] = "status",
[action_exit] = "exit",
};

Expand Down
1 change: 1 addition & 0 deletions src/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum action_type {
action_antialiasing,
action_info,
action_exec,
action_status,
action_exit,
};

Expand Down
4 changes: 4 additions & 0 deletions src/viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,10 @@ void viewer_on_keyboard(xkb_keysym_t key, uint8_t mods)
execute_command(action->params);
redraw = true;
break;
case action_status:
info_set_status("%s", action->params);
redraw = true;
break;
case action_exit:
if (ctx.help) {
switch_help(); // remove help overlay
Expand Down

0 comments on commit a07fcb8

Please sign in to comment.