DWM快捷键配置
#####常用快捷键
Alt + shift + Enter # 打开新窗口
Alt + shift + C # 关闭当前窗口
Alt + D # 窗口横向排列
Alt + I # 窗口竖向排列
Alt + Enter # 窗口位置互换
Alt + num # 切换标签页
Alt + shift + num # 移动窗口至某标签页
Alt + T # 平铺模式(tiling)
Alt + M # 单窗口模式
Alt + F # 浮动模式(float)
# 在窗口间切换
Alt + J
Alt + K
# 改变窗口的长度/比例
Alt + H
Alt + L
# 窗口模式切换
Alt + Space
Alt + shift + Space
多屏幕切换
在主副屏之间移动焦点
Mod + < # 移动焦点至左边屏幕
Mod + > # 移动焦点至右边屏幕
在主副屏之间移动窗口
Mod + shift + < # 移动窗口至左边屏幕
Mod + shift + > # 移动窗口至右边屏幕
缩放窗口
Mod + 鼠标右键
安装DWM
pass
https://blog.csdn.net/cumei1658/article/details/107366061
https://zhuanlan.zhihu.com/p/183861786?utm_source=wechat_session
Linux重新映射键盘
参考链接:https://blog.csdn.net/weixin_33804582/article/details/86031112
1.linux系统下键盘按键的重新映射:xmodmap工具和xev工具
配置DWM快捷键
1.编辑DWM的配置文件config.h
, 在/* commands */
下添加快捷键执行的命令。
# nvim config.h
/* commands */
static const char *lightup[] = {"xbacklight", "-inc", "10", NULL}; # 增加10点亮度:xbacklight -inc 10
static const char *lightdown[] = {"xbacklight", "-dec", "5", NULL}; # 减少5点亮度:xbacklight -dec 5
static const char *soundup[] = {"amixer", "-qM", "sset", "Master", "5%+", "unmute", NULL}; # 增加5%的音量:amixer -qM sset Master 5%+
static const char *sounddown[] = {"amixer", "-qM", "sset", "Master", "10%-", "unmute", NULL}; # 减少10%的音量:amixer -qM sset Master 10%-
static const char *mute[] = {"amixer", "-qM", "sset", "Master", "toggle", NULL}; # 静音:amixer -qM sset Master toggle
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_Left, spawn, {.v = lightup } }, # Alt+左方向键,增加亮度
{ MODKEY, XK_Right, spawn, {.v = lightdown } }, # Alt+右方向键,减少亮度
{ MODKEY, XK_Up, spawn, {.v = soundup } }, # Alt+上方向键,增加音量
{ MODKEY, XK_Down, spawn, {.v = sounddown } }, # Alt+下方向键,减少音量
{ MODKEY, XK_F8, spawn, {.v = mute } }, # Alt+F8,静音
}
2.重新编译DWM
# make
# sudo make clean install
DWM右边状态栏设置
在~/.xinitrc
文件中添加如下内容(一般不会直接写在.xinitrc文件)
while true;do
Battery=$(cat /sys/class/power_supply/BAT1/capacity)%
BatteryStatus=$(cat /sys/class/power_supply/BAT1/status)
if [[ $BatteryStatus == D* ]];then
BatteryStatus='未充电'
else
BatteryStatus='充电中'
fi
Volume=$(amixer get Master |tail -n1 |cut -d'[' -f4 |cut -d']' -f1)
if [[ $Volume == off ]];then
Volume='mute'
else
Volume=$(amixer get Master | sed -n '5p' | cut -d'[' -f2 | cut -d% -f1)
fi
DateTime=$(date +"%a %m-%d %T" )
BackLight=$(xbacklight | cut -d. -f1)
xsetroot -name "Bat.$BackLight|Vol.$Volume|$DateTime|[$BatteryStatus:$Battery]"
sleep 1s
done &
exec dwm