Skip to content
Permalink
Browse files

Add new restart_of_day action.

Same as restart but configuration file is loaded in full.
Unbound by default.

Closes #172
  • Loading branch information
LordReg authored and marcopeereboom committed Feb 21, 2020
1 parent 50ff697 commit dd7b85eaa25ea98fd90e9b9375ef30484cf0eca1
Showing with 12 additions and 0 deletions.
  1. +6 −0 spectrwm.1
  2. +6 −0 spectrwm.c
@@ -772,6 +772,8 @@ menu
quit
.It Cm M-q
restart
.It Aq Ar unbound
restart_of_day
.It Cm M- Ns Aq Cm Space
cycle_layout
.It Cm M-S-\e
@@ -941,6 +943,10 @@ Quit
.It Cm restart
Restart
.Nm .
.It Cm restart_of_day
Same as
.Ic restart
but configuration file is loaded in full.
.It Cm cycle_layout
Cycle layout.
.It Cm flip_layout
@@ -711,6 +711,7 @@ union arg {
#define SWM_ARG_ID_CYCLERG_MOVE_DOWN (113)
#define SWM_ARG_ID_WS_EMPTY (120)
#define SWM_ARG_ID_WS_EMPTY_MOVE (121)
#define SWM_ARG_ID_RESTARTOFDAY (130)
char **argv;
};

@@ -981,6 +982,7 @@ enum actionid {
FN_RESIZE,
FN_RESIZE_CENTERED,
FN_RESTART,
FN_RESTART_OF_DAY,
FN_RG_1,
FN_RG_2,
FN_RG_3,
@@ -4258,6 +4260,9 @@ restart(struct binding *bp, struct swm_region *r, union arg *args)

shutdown_cleanup();

if (args->id == SWM_ARG_ID_RESTARTOFDAY)
unsetenv("SWM_STARTED");

execvp(start_argv[0], start_argv);
warn("execvp failed");
quit(NULL, NULL, NULL);
@@ -8248,6 +8253,7 @@ struct action {
{ "resize", resize, FN_F_NOREPLAY, {.id = SWM_ARG_ID_DONTCENTER} },
{ "resize_centered", resize, FN_F_NOREPLAY, {.id = SWM_ARG_ID_CENTER} },
{ "restart", restart, 0, {0} },
{ "restart_of_day", restart, 0, {SWM_ARG_ID_RESTARTOFDAY} },
{ "rg_1", focusrg, 0, {.id = 0} },
{ "rg_2", focusrg, 0, {.id = 1} },
{ "rg_3", focusrg, 0, {.id = 2} },

0 comments on commit dd7b85e

Please sign in to comment.
You can’t perform that action at this time.