add a "movetogroup" function, which hides the current window from
display and moves it to another group. useful with the recently added "grouponly" function, giving the ability to use groups as simple virtual desktops (similar to e.g. xmonad, dwm and scrotwm). this doesn't have default keyboard bindings; cwmrc(5) now shows how you could use these functions (use M-1...9 for grouponly1...9 and MS-1...9 for movetogroup1...9 to emulate the default dwm bindings). ok oga@
This commit is contained in:
parent
662b00c143
commit
5dd486dee8
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $Id: calmwm.h,v 1.86 2009/05/14 16:29:58 oga Exp $
|
* $Id: calmwm.h,v 1.87 2009/05/17 17:04:59 sthen Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CALMWM_H_
|
#ifndef _CALMWM_H_
|
||||||
@ -446,6 +446,8 @@ void kbfunc_client_nogroup(struct client_ctx *,
|
|||||||
union arg *);
|
union arg *);
|
||||||
void kbfunc_client_grouptoggle(struct client_ctx *,
|
void kbfunc_client_grouptoggle(struct client_ctx *,
|
||||||
union arg *);
|
union arg *);
|
||||||
|
void kbfunc_client_movetogroup(struct client_ctx *,
|
||||||
|
union arg *);
|
||||||
void kbfunc_client_maximize(struct client_ctx *,
|
void kbfunc_client_maximize(struct client_ctx *,
|
||||||
union arg *);
|
union arg *);
|
||||||
void kbfunc_client_vmaximize(struct client_ctx *,
|
void kbfunc_client_vmaximize(struct client_ctx *,
|
||||||
@ -488,6 +490,7 @@ void group_alltoggle(void);
|
|||||||
void group_sticky_toggle_enter(struct client_ctx *);
|
void group_sticky_toggle_enter(struct client_ctx *);
|
||||||
void group_sticky_toggle_exit(struct client_ctx *);
|
void group_sticky_toggle_exit(struct client_ctx *);
|
||||||
void group_autogroup(struct client_ctx *);
|
void group_autogroup(struct client_ctx *);
|
||||||
|
void group_movetogroup(struct client_ctx *, int);
|
||||||
|
|
||||||
void font_init(struct screen_ctx *);
|
void font_init(struct screen_ctx *);
|
||||||
int font_width(const char *, int);
|
int font_width(const char *, int);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $Id: conf.c,v 1.59 2009/05/14 16:24:04 oga Exp $
|
* $Id: conf.c,v 1.60 2009/05/17 17:04:59 sthen Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
@ -281,6 +281,24 @@ struct {
|
|||||||
{ "grouponly7", kbfunc_client_grouponly, 0, {.i = 7} },
|
{ "grouponly7", kbfunc_client_grouponly, 0, {.i = 7} },
|
||||||
{ "grouponly8", kbfunc_client_grouponly, 0, {.i = 8} },
|
{ "grouponly8", kbfunc_client_grouponly, 0, {.i = 8} },
|
||||||
{ "grouponly9", kbfunc_client_grouponly, 0, {.i = 9} },
|
{ "grouponly9", kbfunc_client_grouponly, 0, {.i = 9} },
|
||||||
|
{ "movetogroup1", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 1} },
|
||||||
|
{ "movetogroup2", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 2} },
|
||||||
|
{ "movetogroup3", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 3} },
|
||||||
|
{ "movetogroup4", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 4} },
|
||||||
|
{ "movetogroup5", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 5} },
|
||||||
|
{ "movetogroup6", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 6} },
|
||||||
|
{ "movetogroup7", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 7} },
|
||||||
|
{ "movetogroup8", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 8} },
|
||||||
|
{ "movetogroup9", kbfunc_client_movetogroup, KBFLAG_NEEDCLIENT,
|
||||||
|
{.i = 9} },
|
||||||
{ "nogroup", kbfunc_client_nogroup, 0, {0} },
|
{ "nogroup", kbfunc_client_nogroup, 0, {0} },
|
||||||
{ "cyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_CYCLEGROUP} },
|
{ "cyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_CYCLEGROUP} },
|
||||||
{ "rcyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_RCYCLEGROUP} },
|
{ "rcyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_RCYCLEGROUP} },
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.\" $OpenBSD: cwmrc.5,v 1.23 2009/05/14 16:24:04 oga Exp $
|
.\" $OpenBSD: cwmrc.5,v 1.24 2009/05/17 17:04:59 sthen Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
|
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
|
||||||
.\"
|
.\"
|
||||||
@ -14,7 +14,7 @@
|
|||||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: May 14 2009 $
|
.Dd $Mdocdate: May 17 2009 $
|
||||||
.Dt CWMRC 5
|
.Dt CWMRC 5
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -208,6 +208,12 @@ ignore xclock
|
|||||||
bind CM-r label
|
bind CM-r label
|
||||||
bind CS-Return "xterm -e top"
|
bind CS-Return "xterm -e top"
|
||||||
bind 4-o unmap
|
bind 4-o unmap
|
||||||
|
bind M-1 grouponly1
|
||||||
|
bind M-2 grouponly2
|
||||||
|
bind M-3 grouponly3
|
||||||
|
bind MS-1 movetogroup1
|
||||||
|
bind MS-2 movetogroup2
|
||||||
|
bind MS-3 movetogroup3
|
||||||
|
|
||||||
# Mousebindings
|
# Mousebindings
|
||||||
mousebind M-2 window_lower
|
mousebind M-2 window_lower
|
||||||
@ -250,6 +256,8 @@ but also hides the other groups.
|
|||||||
Select all groups.
|
Select all groups.
|
||||||
.It grouptoggle
|
.It grouptoggle
|
||||||
Toggle group membership of current window.
|
Toggle group membership of current window.
|
||||||
|
.It movetogroup[n]
|
||||||
|
Hide current window from display and move to group n, where n is 1-9.
|
||||||
.It cyclegroup
|
.It cyclegroup
|
||||||
Forward cycle through groups.
|
Forward cycle through groups.
|
||||||
.It rcyclegroup
|
.It rcyclegroup
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $Id: group.c,v 1.24 2009/05/14 16:24:04 oga Exp $
|
* $Id: group.c,v 1.25 2009/05/17 17:04:59 sthen Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
@ -143,7 +143,16 @@ group_init(void)
|
|||||||
TAILQ_INSERT_TAIL(&Groupq, &Groups[i], entry);
|
TAILQ_INSERT_TAIL(&Groupq, &Groups[i], entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
Group_active = &Groups[0];
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
group_movetogroup(struct client_ctx *cc, int idx)
|
||||||
|
{
|
||||||
|
if (idx < 0 || idx >= CALMWM_NGROUPS)
|
||||||
|
err(1, "group_movetogroup: index out of range (%d)", idx);
|
||||||
|
|
||||||
|
client_hide(cc);
|
||||||
|
_group_add(&Groups[idx], cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* $Id: kbfunc.c,v 1.37 2009/05/14 16:24:04 oga Exp $
|
* $Id: kbfunc.c,v 1.38 2009/05/17 17:04:59 sthen Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
@ -466,6 +466,12 @@ kbfunc_client_grouptoggle(struct client_ctx *cc, union arg *arg)
|
|||||||
group_sticky_toggle_enter(cc);
|
group_sticky_toggle_enter(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
kbfunc_client_movetogroup(struct client_ctx *cc, union arg *arg)
|
||||||
|
{
|
||||||
|
group_movetogroup(cc, KBTOGROUP(arg->i));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
kbfunc_client_maximize(struct client_ctx *cc, union arg *arg)
|
kbfunc_client_maximize(struct client_ctx *cc, union arg *arg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user