Skip to content

Commit 7ac8a57

Browse files
committed
add cmds for a rofi menu and keybd ctl
rofi menu - for custom assorted rofi menu keybd ctl - a keybinding to switch keyboard layouts
1 parent 52a47df commit 7ac8a57

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

config.h

+15-8
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ static const Layout layouts[] = {
6565
/* commands */
6666
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
6767
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
68-
static const char *termcmd[] = { "st", NULL };
68+
static const char *roficmd[] = { "my-rofi", NULL };
6969

70+
// st
71+
static const char *termcmd[] = { "st", NULL };
7072
// urxvt
7173
static const char *utermcmd[] = { "urxvtc", NULL };
7274
// firefox
@@ -78,27 +80,32 @@ static const char *worspcmd[] = { "wor-sp", NULL };
7880
// context aware smart prefix
7981
static const char *spcmd[] = { "smart-prefix", NULL };
8082
// custom status display command
81-
static const char *statuscmd[] = { "mouse-status", NULL };
83+
static const char *statuscmd[] = { "system-status", NULL };
8284
// lock only keyboard
8385
static const char *screenlockcmd[] = { "rlock", "-k", NULL };
86+
// custom status display command
87+
static const char *keybdcmd[] = { "keybd-command", NULL };
8488

8589

8690
static Key keys[] = {
8791
/* modifier key function argument */
8892
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
93+
{ MODKEY|ShiftMask, XK_p, spawn, {.v = roficmd } },
8994
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
9095
// firefox
91-
{ MODKEY|ShiftMask, XK_f, spawn, {.v = ffcmd } },
96+
{ MODKEY|ShiftMask, XK_f, spawn, {.v = ffcmd } },
9297
// urxvt
93-
{ MODKEY|ShiftMask, XK_u, spawn, {.v = utermcmd } },
98+
{ MODKEY|ShiftMask, XK_u, spawn, {.v = utermcmd } },
9499
// tmux prefix manager
95-
{ MODKEY|ShiftMask, XK_s, spawn, {.v = spcmd } },
100+
{ MODKEY|ShiftMask, XK_s, spawn, {.v = spcmd } },
96101
// drop down terminal
97-
{ MODKEY, XK_o, spawn, {.v = termdropcmd } },
102+
{ MODKEY, XK_o, spawn, {.v = termdropcmd } },
98103
// wor terminal
99-
{ MODKEY|ShiftMask, XK_o, spawn, {.v = worspcmd } },
104+
{ MODKEY|ShiftMask, XK_o, spawn, {.v = worspcmd } },
100105
// status command
101-
{ MODKEY, XK_s, spawn, {.v = statuscmd } },
106+
{ MODKEY, XK_s, spawn, {.v = statuscmd } },
107+
// toggle number row
108+
{ MODKEY|ShiftMask, XK_k, spawn, {.v = keybdcmd } },
102109
// move to adjacent tags
103110
{ MODKEY, XK_Right, view_adjacent, { .i = +1 } },
104111
{ MODKEY, XK_Left, view_adjacent, { .i = -1 } },

keybd-command

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
if [ -f ~/.keybd_toggled ]; then
4+
# set it to normal
5+
setxkbmap -layout us
6+
rm ~/.keybd_toggled
7+
xsetroot -name " Num row mode "
8+
else
9+
xmodmap ~/Customization/dotfiles/.Xmodmap
10+
touch ~/.keybd_toggled
11+
xsetroot -name " Toggled num row mode "
12+
fi

my-rofi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
rofi -show combi -show-icons -combi-modi window,drun

smart-prefix

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ WINNAME=$(xdotool getwindowfocus getwindowname)
44

55
# requires specifc tmux title configuration
66
if [[ $WINNAME =~ emacs.* ]]; then
7-
# toggle clockin-clockout
7+
# open terminal in dir of emacs buffer
88
# depends on corresponding snippet in .emacs
99
xdotool key F5
1010
elif [[ $WINNAME =~ tmux.* ]]; then
1111
# send tmux prefix sequence
1212
xdotool key ctrl+b
1313
else
14-
# open new urxvt window
15-
xdotool key alt+shift+u
14+
# open new st window
15+
xdotool key alt+shift+Return
1616
fi

0 commit comments

Comments
 (0)