在gentoo上使用sway
更多分享内容可访问我的个人博客
https://www.niuiic.top/
本文记录在 gentoo 上使用 sway 遇到的一些问题和解决方案。
键位设置
查看输入设备。
export SWAYSOCK=$(ls /run/user/*/sway-ipc* | head -n 1)
swaymsg -t get_inputs
查看键位设置。
man 7 xkeyboard-config
案例如下。可以使用设备类型,也可以使用设备名称。
input "type:keyboard" {xkb_layout usxkb_options ctrl:swap_lalt_lctl,caps:swapescape
}input "1:1:AT_Translated_Set_2_keyboard" {xkb_layout us
}
详见文档。
触控板设置
基本同上。案例如下。
input type:touchpad {scroll_method two_fingertap enabledtap_button_map lrm
}
组件
可以在这里查看一些有用的组件。
输入法
fcitx5 可以在大部分应用上使用,而且也不会出现候选项框错位和无法显示的情况。部分应用,如 utools,依旧无法使用,这一点暂时无解。
安装以下包即可。其中x11-libs/xcb-imdkit
是关键,上面提到的两个问题基本上就是缺失这引起的。另外笔者在全局禁用了X
USE Flag,并启用了wayland
,同时为部分包启用了X
。这可能成为影响因素。
app-i18n/fcitx5
x11-libs/xcb-imdkit
app-i18n/fcitx5-chinese-addons
app-i18n/libime
app-i18n/fcitx5-qt
app-i18n/fcitx5-gtk
然后在~/.zprofile
加入以下内容。注意这是 zsh 启动时加载的文件,如果你使用的不是 zsh, 那么需要自行替换成对应的。另外也可以参考 Arch wiki 中的写法,使用.pam_envrionment
文件。
export GTK_IM_MODULE=fcitx5
export QT_IM_MODULE=fcitx5
export XMODIFIERS="@im=fcitx"
剪贴板
使用gui-apps/wl-clipboard
代替xclip
。但是部分软件,如utools
,无法自动检测剪贴板内容。
waybar 切换与自动隐藏
切换 waybar 可以使用以下脚本。
# toggle_bar.sh
haswaybar=$(ps aux)
haswaybar=$(echo -e $haswaybar | grep "waybar")
if [[ $haswaybar != "" ]]; thenkillall waybar
elsewaybar &
fi
注意killall waybar
足以,如果用网上的-SIGUSR1 '^waybar$'
的版本则 waybar 进程虽退出,但仍占据原有空间。
可以在 sway 的配置中设置快捷键调用该脚本。注意该脚本的路径不能含有waybar
,建议放在~/.config/sway
目录下。
waybar 的自动隐藏功能目前已经实现,但该版本的 sway 和 waybar 暂无 release,需要自己编译。具体可见antyhrabia 的回答。
waybar 配置
可以在 github 上搜索别人写好的配置。这里推荐一个,是笔者在sora6kq 的配置上自行修改的。其中用到的一些软件需要自行安装或者替换。
~/.config/waybar/config
{"layer": "bottom","position": "bottom", // Waybar position (top|bottom|left|right)"ipc": true,"height": 35,//"width": 1250, // Waybar width// Choose the order of the modules idle_inhibitor"modules-left": ["custom/launcher","sway/workspaces","sway/mode","sway/window"],"modules-right": ["network","cpu","memory","disk","temperature","battery","pulseaudio","backlight","clock"],// Modules configuration"sway/workspaces": {"disable-scroll": true,"all-outputs": true,"format": "{icon}","format-icons": {"1": "1","2": "2","3": "3","4": "4","5": "5","6": "6","7": "7","8": "8","9": "9","10": "10"}},"sway/mode": {"format": "<span style=\"italic\">{}</span>"},"sway/window": {"format": "{}"},"clock": {"tooltip-format": "{:%A %B %d %Y | %H:%M}",// "format": " {:%a %d %b %I:%M %p}", //12 hour format"format": " {:%a %d %b %H:%M}", //24 hour format"format-alt": " {:%d/%m/%Y %H:%M:%S}","timezones": ["Asia/Shanghai"],//"max-length": 200"interval": 1},"cpu": {"format": " {usage}%","on-click": "terminator -e htop"},"memory": {"format": " {}%","on-click": "terminator -e htop"},"temperature": {"thermal-zone": 2,"hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input","critical-threshold": 80,"format-critical": " {temperatureC}°C","format": " {temperatureC}°C"},"backlight": {// "device": "acpi_video1","format": "{icon} {percent}%","format-icons": ["", ""],"on-scroll-down": "sudo xbacklight -dec 5","on-scroll-up": "sudo xbacklight -inc 5"},"battery": {"states": {// "good": 95,"warning": 30,"critical": 15},"format": "{icon} {capacity}%",// "format-good": "", // An empty format will hide the module// "format-full": "","format-icons": ["", "", "", "", ""]//"format-icons": ["", "", "", "", "", "", "", "", "", ""]},"network": {"interface": "wlp2s0", // (Optional) To force the use of this interface"format": "⚠ Disabled","format-wifi": " {signalStrength}% {essid} ↑ {bandwidthUpBits} ↓ {bandwidthDownBits}","format-ethernet": " {ifname}: {ipaddr}/{cidr}","format-disconnected": "⚠ Disconnected","interval": 1,"on-click": "terminator -e nethogs"},"pulseaudio": {"scroll-step": 5,"format": "{icon} {volume}%","format-bluetooth": "{icon} {volume}%","format-muted": "","format-icons": {"headphones": "","handsfree": "","headset": "","phone": "","portable": "","car": "","default": ["", ""]},"on-click": "terminator -e alsamixer"},"custom/launcher": {"format": "","on-click": "exec rofi -show drun","tooltip": false},"disk": {"interval": 30,"format": "
在gentoo上使用sway相关推荐
- 在debian和gentoo上安装摄像头驱动程序及应用
首先到http://mxhaard.free.fr处下载的需的驱动,内核版本是2.6.11以上的用gspca,2.6.11以下的用spca5xx(这也不是绝对的,因为我曾在2.6.17下也驱动成功过) ...
- 在x86上成功使用gentoo系统上安装的grub2启动 Mac OS X Leopard 10.5.7
机器: thinkpad w500 环境: /dev/sda1 gentoo-x86_64 /dev/sda2 iAKTKOS v7 10.5.7 grub2 安装在MBR, 在gentoo上安装gr ...
- Gentoo rc-update service ‘net.eth0′ does not exist
最近迷上了Gentoo,并相信以后也会把更多的精力放在Gentoo上,不过Gentoo的安装的过程的确让很多人却步. 本文只提到添加net.eth0到默认的运行级别时一个很小的报错解决. # nano ...
- gentoo on macbook pro driver for the Broadcom Facetime HD webcam
gentoo on macbook pro 按 gentoo wiki 配置kernel 选项后, 仍然不能使用摄像头 Device Drivers ---> <M> Multime ...
- Gentoo Linux HPPA 手冊
Gentoo Linux HPPA 手冊 Sven Vermeulen Author Roy Marples Author Daniel Robbins Author Chris Hous ...
- Gentoo Linux 2005.0 x86 手冊
內容: 安裝 Gentoo 這個部份將帶領您進行 Gentoo 的安裝. 關於 Gentoo Linux 安裝步驟. 不熟悉 Gentoo 的使用者並不了解 Gentoo 的選擇. 使用 Univer ...
- Linux中如何使用Htop监控工具?【网络安全】
一.Htop界面展示 "Htop是一个用于Linux/Unix系统的交互式实时进程监控应用程序,也是top命令的替代品,它是所有Linux操作系统上预装的默认进程监控工具. Htop还有许多 ...
- Linux有问必答:怎么用CheckInstall从源码创建一个RPM或DEB包
Linux有问必答:怎么用CheckInstall从源码创建一个RPM或DEB包 问题:我想要从源码创建安装的软件包.有没有一种方式从源码来创建和安装软件包,而不是运行"make insta ...
- 个人linux版本管理,浅谈各个Linux版本的个人看法
Android Android手机是一个基于Linux内核的操作系统,这个版本相信大家没有异议,因为与iphone手机可以相提并论以外,就是最好用的操作系统,当然这应该是局限以移动端设备,因为它就是为 ...
最新文章
- ICE简单介绍及使用示例
- python画图颜色表示大小变化_python画图(线条颜色、大小、类型:点、虚线等)(图文详细入门教程四)...
- 排序算法之——选择排序
- 管理运筹学软件计算机解咋看,运筹学软件结果解析总结计划题1-20210618123710.docx-原创力文档...
- server sql 分组 去重 字符串拼接_SQL必知必会
- 获取textarea每一行的内容_PLC编程的基本原则和方法,64页内容介绍PLC编程,值得收藏...
- git pull没有更新成功_关于git pull时出现的问题及解决反思
- C#保存PictureBox或Bitmap图片为bmp|png|gif|jpg格式
- Vue项目中使用eslint的笔录,编辑器采用sublime3
- 如何去掉CAD教育版打印戳记
- 数据库设计—图书管理数据库系统设计
- tf.flags用法
- WSO2安装使用的全过程详解
- 分组急救技能竞赛方法在急诊专科护士培训中的运用
- 速收藏 !回复审稿人意见时常用的英文套话
- nginx: [warn] conflicting server name aaa.bbbb.com on 0.0.0.0:80, ignored
- 通过cmd注销服务器,如何通过cmd命令远程重启或远程关闭Windows服务器
- django创建应用程序_使用Django创建基于机器学习的Web应用程序
- 互融云人行二代征信对接服务 解决征信对接常见问题
- 如何学习前端?看这篇就够了
热门文章
- 19、交换机基本命令
- 【CVPR2020】百度入选22篇论文涵盖全视觉领域!
- BSCI、SA8000、SEDEXSMETA三项社会责任验厂有何区别?
- 云计算课程笔记10089
- 带你了解 HTTP 协议
- 关于宗海图WGS84转CGCS2000的问题
- java计算机毕业设计心理学网站源程序+mysql+系统+lw文档+远程调试
- 北京大学计算机学院陈鹏进,计算机科学技术系本科生在SIGCOMM 2020上发表高性能可见光反射互联技术论文...
- 影视解说伪原创软件v.1.2.3
- ABC: Always Be Coding