“未来将属于两种人:思想的人和劳动的人。实际上,这两种人是一种人,因为思想也是劳动。”
——维克多·雨果

贴上效果图:

^ konsole

^ VS Code - OSS

i3是一个基于Xorg的平铺式窗口管理器,高效的快捷键组合与平铺式桌面管理方式带来了更加沉浸式的工作体验,能够减少不必要的外界干扰,引领更专注、更高效的工作体验。

[注]本文假设读者已经完成了Arch Linux基础系统的安装并具有一定linux基础。

一、准备工作

(先配置archlinuxcn源并已安装yay,具体可参考我的另一篇博客)

yay -S xorg xorg-xinit i3 konsole feh picom conky devilspie transset-df polybar

konsle:KDE官方终端模拟器,成熟稳定、功能强大、操作友好。很多人会推荐URxvt,笔者认为它比较陈旧复杂,性能与konsole并没有明显区别,我们选择更新更成熟的konsole。
feh:一个简洁的图片工具,这里用于渲染背景图片。
picom:一个轻量级混合窗口管理器,便于在简单窗口管理器上实现较华丽的阴影、透明等效果,继承自compton,而后者又继承自xcompmgr-dana,xcompmgr-dana继承自xcompmgr。
conky:Linux系统强大的系统监测程序。
transset-df:基于Xorg一个调节窗口透明度的脚本。
devilspie:一个轻量级窗口绑定工具,用于打开指定窗口时自动调用transset-df。
rofi:类似Windows开始菜单,比dmenu配置性更强。
polybar:一个自由度极高的状态栏。

二、设置DPI

配置文件位于 $HOME/.Xresources
关于这个配置文件可以参阅Archwiki。
输入:

Xft.dpi: 192

[注]dpi具体值可以根据自己调整,一般1080P屏幕96~120,2K屏幕144~192,4K屏幕192及以上。笔者是4K-3840x2160的15.6寸屏幕,dpi设为168约为效果图中大小(较小),供参考。

三、i3基本配置

选择启动桌面环境的方式:
如果喜欢在tty的环境用startx,编辑~/.xinitrc
最后一行exec处改为

exec i3

如果使用dm,直接选择i3进入即可。
进入i3桌面,$Mod + Enter运行:

i3-config-wizard

(一般会进入时自动运行),生成i3基本配置文件。

关于i3默认基本快捷键,参考:
https://blog.csdn.net/weixin_42826353/article/details/107987791
来自官方文档中文翻译。

i3配置位于 ~/.config/i3/config

首先要清楚的是i3wm的特色是可以绑定各种快捷键,当然大部分是与mod有关,mod键可以由用户设定,可以是alt(Mod1)或者是win(Mod4)。

•设置win键为mod键,在配置文件里添加:

set $mod Mod4

配置文件里设置自启picom

exec --no-startup-id picom -b #开机自启

•win+enter键启动konsole

bindsym $mod+Return exec konsole --hide-menubar

•设置壁纸

exec_always --no-startup-id feh --bg-scale "/path/xxx.jpg"

•按键盘上的print键全屏截图,按win+print键用户自选区域截图(需要安装shutter)

bindsym Print exec shutter -f -e -o ~/Pictures/shot/%Y-%m-%d-%T.png
bindsym $mod+Print exec shutter -s -e -o ~/Pictures/shot/%Y-%m-%d-%T.png

这里表示将截图保存在~/Picture/shot/文件夹里,名字为年-月-日-时间.png格式,当然了这些自己随便设定。

•黑屏时间设定,即多久用户无操作黑屏i3wm的黑屏和屏保是一个意思,但是都得设置,如下:

先把关闭屏保功能:

exec --no-startup-id xset s 0

然后黑屏、睡眠、断电时间分别设为6000s,8000s,9000s

exec --no-startup-id xset dpms 6000 8000 9000

•win+shift+减号实现隐藏一个窗口,win+减号重新打开

bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show

还有很多基本的功能,请参照i3wm官网手册来自己写,也可以参照手册中文翻译。

3.1 工作区的配置

下面的代码可以实现将我比较常用的软件在用户设定的工作区打开,下面是代码:

#打开URxvt的同时切换到tab模式

for_window [class="URxvt"] layout tabbed
#打开软件时自动移至相应工作区
assign [class="URxvt"] $WS1
assign [class="Thunar"] $WS1
assign [class="Firefox"] $WS2
assign [class="Zathura"] $WS3
assign [class="Gvim"] $WS4
assign [class="Ise"] $WS5
assign [class="VirtualBox"] $WS6

3.2 电源管理

win+c可以调出选项,你可以选择锁屏(L),注销(O),重启®,关机(S),退出选项(Esc)。

#*********************************************电源管理*************************************
set $mode_system  lock(L) logout(O) reboot(R) shutdown(S) exit(Esc)
bindsym $mod+c mode "$mode_system"
mode "$mode_system" {bindsym l exec --no-startup-id i3lock -c '#000000', mode "default"bindsym o exec --no-startup-id i3-msg exit, mode "default"bindsym r exec --no-startup-id systemctl reboot, mode "default"bindsym s exec --no-startup-id systemctl poweroff, mode "default"bindsym Escape mode "default"
}

3.3 i3bar美化

注意:这里需要安装ttf-font-awesome字体,可以通过pacman安装或手动安装。

~/.config/i3/jconky:

#!/bin/sh# Send the header so that i3bar knows we want to use JSON:
echo '{"version":1}'# Begin the endless array.
echo '['# We send an empty first array of blocks to make the loop simpler:
echo '[],'# Now send blocks with information forever:
exec conky -c ~/.config/i3/conkyrc.lua

~/.config/i3/conkyrc.lua

conky.config = {out_to_x = false,out_to_console = true,background = false,double_buffer = false,update_interval = 1,total_run_times = 0,override_utf8_locale = false,short_units = true,if_up_strictness = 'address',cpu_avg_samples = 2,};conky.text = [[
[
#{ "full_text" : "", "color": "\#BADA55"},
#{ "full_text": " ${exec curl icanhazip.com}"},
{ "full_text" : ${if_up eno1}"  ${upspeed eno1}/s  ${downspeed eno1}/s"${else}""${endif}, "color" : "\#94F397" },
{ "full_text" : ${if_up wlo1}"  ${upspeed wlo1}/s  ${downspeed wlo1}/s"${else}""${endif}, "color" : "\#94F397" },
{ "full_text" : " ${cpu cpu0}%" , "color" : "\#8BC3E7" },
{ "full_text" : " ${mem}" , "color" : "\#B987D9" },
{ "full_text" : " ${fs_used_perc /}%" , "color" : "\#FF9D17" },
{ "full_text" : " ${battery_percent}%" , "color" : "\#A4DC6A" },
{ "full_text" : " ${time %Y/%m/%d %a}" , "color" : "\#ff797b" },
{ "full_text" : " ${time %H:%M}" , "color" : "\#8BADF9" }
],
]];

[注]从conky1.10开始,conkyrc使用lua脚本呈现。
conkyrc可以使用convert.lua转换到lua脚本
https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua

[注]本段代码可能会有字体问题出现乱码,安装Awesome字体后可以解决。

i3config中添加:

#**************************************************主题设置*********************************************
# 窗口颜色                边框    背景    文字    提示
client.focused          #333333 #333333 #FFFFFF #333333
client.focused_inactive #999999 #999999 #FFFFFF #3399FF
client.unfocused        #999999 #999999 #FFFFFF #3399FF
client.urgent           #990000 #990000 #FFFFFF #990000
client.placeholder      #000000 #000000 #FFFFFF #000000
client.background       #FFFFFF#i3bar设置
bar {i3bar_command i3bar -theight 28#禁止systemtraytray_output none# i3bar调用status_command ~/.config/i3/jconky# 显示位置top/bottomposition bottom# 是否隐藏#mode hide# 拆解工作区名(隐藏前面的1:2:3:……)strip_workspace_numbers yes# 定义分隔符∥>separator_symbol "  >  "colors {background #10101000statusline #FFFFFFseparator  #3399FF# 工作区颜色         边框    背景    文字focused_workspace  #3297FD #11111100 #FFFFFFactive_workspace   #FFFFFF #FFFFFF00 #FFFFFFinactive_workspace #111111 #11111100 #FFFFFFurgent_workspace   #990000 #11111100 #FFFFFFbinding_mode       #990000 #99000000 #FFFFFF}
}

3.4 i3gaps
可以透明化i3bar,也可以在使窗口之间设定透明间隔
参考https://github.com/Airblader/i3。
Arch Repo默认安装的即为i3-gaps

贴如下配置

#********************************************i3-gaps*********************************
for_window [class="^.*"] border pixel 0
gaps inner 8
gaps outer 6
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"mode "$mode_gaps" {bindsym o      mode "$mode_gaps_outer"bindsym i      mode "$mode_gaps_inner"bindsym Return mode "default"bindsym Escape mode "default"
}mode "$mode_gaps_inner" {bindsym plus  gaps inner current plus 5bindsym minus gaps inner current minus 5bindsym 0     gaps inner current set 0bindsym Shift+plus  gaps inner all plus 5bindsym Shift+minus gaps inner all minus 5bindsym Shift+0     gaps inner all set 0bindsym Return mode "default"bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {bindsym plus  gaps outer current plus 5bindsym minus gaps outer current minus 5bindsym 0     gaps outer current set 0bindsym Shift+plus  gaps outer all plus 5bindsym Shift+minus gaps outer all minus 5bindsym Shift+0     gaps outer all set 0bindsym Return mode "default"bindsym Escape mode "default"
}

devispie配置:

~/.devilspie/opacity.ds

( if( or( contains ( window_class ) "Gvim" )( contains ( application_name ) "Konsole" )( contains ( application_name ) "Code - OSS" ))( begin( spawn_async (str "transset-df -t -i " (window_xid)  ))))

关于阴影等设置,可以参考 Archwiki - picom 。

关于中文输入法,可以参考 Archwiki - Fcitx 或 我的前一篇文章 。

关于终端,笔者使用的是fish,一种交互式Shell,使用oh-my-fish美化。fish语法与bash、zsh有巨大的区别(zsh基本完全向下兼容bash),从zsh更换需要谨慎。

关于壁纸,笔者壁纸来自Apple.Inc,为Mojave-Night。

关于i3config、polybar、conkyrc、devilspie语法,读者可以自主深入理解。

polybar文件再此直接贴出:

[colors]
background = #000020
background-alt = #444
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40[bar/intel]
monitor = ${env:MONITOR:eDP1}
wwidth = 100%
height = 50
;offset-x = 1%
;offset-y = 1%
;radius = 6.0
fixed-center = truebackground = ${colors.background}
foreground = ${colors.foreground}line-size = 3
line-color = #f00;border-top-size = 4
;border-left-size = 4
;border-right-size = 4
;border-color = #00000000padding-left = 0
padding-right = 2module-margin-left = 2
module-margin-right = 2font-0 = "Ubuntu Nerd Font:fixed:size=20;1"
font-1 = "Ubuntu Nerd Font:size=20:antialias=false;2"
font-2 = "Font Awesome 5 Free:style=Solid:pixelsize=24;1"
font-3 = "Font Awesome 5 Brands:style=Regular:pixelsize=24;1"
font-4 = "material icons:pixelsize=24;3"modules-left = i3 xwindow
;modules-center = mpdmodules-right = alsa wlan date;tray-position = right
;tray-padding = 2
;tray-background = ${colors.background}cursor-click = pointer
cursor-scroll = ns-resize[bar/nvidia]
monitor = ${env:MONITOR:eDP-1-1}
width = 100%
height = 50
;offset-x = 1%
;offset-y = 1%
;radius = 6.0
fixed-center = truebackground = ${colors.background}
foreground = ${colors.foreground}line-size = 3
line-color = #f00;border-top-size = 4
;border-left-size = 4
;border-right-size = 4
;border-color = #00000000padding-left = 0
padding-right = 2module-margin-left = 2
module-margin-right = 2font-0 = "Ubuntu Nerd Font:fixed:size=20;1"
font-1 = "Ubuntu Nerd Font:size=20:antialias=false;2"
font-2 = "Font Awesome 5 Free:style=Solid:pixelsize=24;1"
font-3 = "Font Awesome 5 Brands:style=Regular:pixelsize=24;1"
font-4 = "material icons:pixelsize=24;3"modules-left = i3 xwindow
;modules-center = mpdmodules-right = alsa wlan powermenu;tray-position = right
;tray-padding = 2
;tray-background = ${colors.background}cursor-click = pointer
cursor-scroll = ns-resize[module/xwindow]
type = internal/xwindow
label = %title%
width = 50
label-maxlen = 45[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lockformat-prefix = ""
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}label-layout = %layout%
label-layout-underline = ${colors.secondary}label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}[module/filesystem]
type = internal/fs
interval = 25mount-0 = /label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}[module/bspwm]
type = internal/bspwmlabel-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2label-occupied = %index%
label-occupied-padding = 2label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = falselabel-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}label-unfocused-padding = ${module/bspwm.label-occupied-padding}label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding} |[module/mpd]
type = internal/mpd
format-online =  <icon-prev>  <icon-stop>  <toggle>  <icon-next>  <icon-repeat>  <label-song>;label-offline = mpd is offlineicon-prev = 
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 
icon-repeat = 
icon-repeatone = 
icon-random = toggle-on-foreground = #ff
toggle-off-foreground = #55label-song-maxlen = 25
label-song-ellipsis = true;[module/xbacklight]
;type = internal/xbacklight;format = <label> <bar>
;label = BL;bar-width = 10
;bar-indicator = |
;bar-indicator-foreground = #ff
;bar-indicator-font = 2
;bar-fill = ─
;bar-fill-font = 2
;bar-fill-foreground = #9f78e1
;bar-empty = ─
;bar-empty-font = 2
;bar-empty-foreground = ${colors.foreground-alt};[module/backlight-acpi]
;inherit = module/xbacklight
;type = internal/backlight
;card = intel_backlight[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
;format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%[module/memory]
type = internal/memory
interval = 2
format-prefix = "▦"
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #4bffdc
label = %percentage_used%%[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0format-connected = <ramp-signal>
format-connected-underline = #9f78e1
label-connected = "%essid%"format-disconnected = 
;format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected = %ifname% disconnected
label-disconnected-foreground = #999999ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
animation-packetloss-0 = ⚠
animation-packetloss-0-foreground = #ffa64c
;ramp-signal-foreground = ${colors.foreground-alt};[module/eth]
;type = internal/network
;interface = eno1
;interval = 3.0;format-connected-underline = #55aa55
;format-connected-prefix = "												

ArchLinux开发环境第2辑——高效平铺式桌面i3个性化配置与美化相关推荐

  1. archlinux什么桌面好_ArchLinux搭建高效便捷的平铺式桌面

    一不注意竟然已经三个多月没写文章了,十一月份总算找到感觉比较满意的实习工作了,同时把近视给弄好了,已经有十多年没有这么清晰地看过这个世界了:-D 前言 关于ArchLinux请自己谷歌度娘,由于整个工 ...

  2. 如何在Arch Linux搭建高效便捷的平铺式桌面

    一不注意竟然已经三个多月没写文章了,十一月份总算找到感觉比较满意的实习工作了,同时把近视给弄好了,已经有十多年没有这么清晰地看过这个世界了:-D 前言 关于ArchLinux请自己谷歌度娘,由于整个工 ...

  3. linux 平铺式桌面,Terminix:基于 GTK3 的平铺式 Linux 终端模拟器

    导读 现在,你可以很容易的找到大量的 Linux 终端模拟器,每一个都可以给用户留下深刻的印象.但是,很多时候,我们会很难根据我们的喜好来找到一款心仪的日常使用的终端模拟器.这篇文章中,我们将会推荐一 ...

  4. linux 平铺式桌面,Linux下5 个很酷的平铺窗口管理器

    Linux 桌面生态中有多种窗口管理器(WM).有些是作为桌面环境的一部分开发的.有的则被用作独立程序.平铺窗口管理器就是这种情况,它提供了一个更轻量级的自定义环境.本文介绍了五种这样的平铺窗口管理器 ...

  5. Mac上的平铺式桌面:chunkwm

    背景 之前在装Arch的时候使用了i3wm的桌面管理,结合Vim键位绑定,感觉很简洁.高效.于是尝试寻找了一下Mac上有没有类似的工具,找到了chunkwm, 以下是简单的配置过程. 流水 # 使用b ...

  6. android终端模拟器 yum,分享|Terminix:一个很赞的基于 GTK3 的平铺式 Linux 终端模拟器...

    现在,你可以很容易的找到大量的 Linux 终端模拟器,每一个都可以给用户留下深刻的印象. 但是,很多时候,我们会很难根据我们的喜好来找到一款心仪的日常使用的终端模拟器.这篇文章中,我们将会推荐一款叫 ...

  7. Dvtm -- 平铺式终端

    Dvtm -- 平铺式终端_Linux伊甸园开源社区-24小时滚动更新开源资讯,全年无休! Dvtm -- 平铺式终端 关注我们: 如果你使用过 Dwn 或 Awesome 这种平铺式窗口管理器,一定 ...

  8. 集成开发环境PL/SQL Developer v13.0新功能(二)——PL / SQL美化功能增强

    Allround Automations是一家位于荷兰的私人控股公司.该公司成立于1989年,在Oracle开发工具方面是全球领先的服务提供商.其中,产品PL/SQL Developer是一个集成开发 ...

  9. 基于Anaconda配置Python开发环境详解(1)安装Anaconda并做基本配置

    本系列帖子将从纯小白的视角讲解新手使用Anaconda配置Python开发环境全流程,使用Pycharm编辑器.conda包管理器. 第一节是关于Anaconda安装的 什么是conda conda是 ...

最新文章

  1. 将request中的所有参数存放到自定义的map中
  2. Vue的百度地图插件尝试
  3. python gui label_更新tkinter Label以在pythongui上显示一个文本文件,每次一行
  4. python实现logistic_使用python实现logistic二分类
  5. 【HDU - 5965】扫雷(dp)
  6. Linux Vim三种工作模式(命令模式、输入模式和编辑模式)详解
  7. 分布式锁 动态代理 Java数据结构List,Set,Map,Spring执行流程,Spring MVC组件
  8. 阿里云镜像下载ubuntu 1
  9. 详解微信小程序开发(项目从零开始)
  10. hadoop安装和基本知识
  11. 人脸识别(81关键点)经典开源核心代码
  12. 从jieba分词到BERT-wwm——中文自然语言处理(NLP)基础分享系列(1)
  13. 视觉世界中的“众里寻她”--开放环境下的人物特征表示
  14. 如何用计算机控制家带你开关,kg316t微电脑时控开关怎么调 微电脑时控开关设置方法【图文】...
  15. u盘linux系统安装文件,使用U盘安装LINUX系统
  16. 银行业务用语大全(中英文)
  17. 关于功耗芯片那些事(四)
  18. 【汇正财经】股票价格有哪些分类?
  19. linux fetion
  20. Drupal菜鸟笔记之使用Paragraphs建站

热门文章

  1. 银河英雄传说 acwing-238 并查集
  2. 导致请求失败 设备硬件出现致命错误_硬盘提示无法访问设备硬件出现致命错误,导致请求失败,里面的数据如何找到...
  3. win7浏览器主页修改不过来_Win7系统IE浏览器无法更改主页怎么解决?
  4. Deep Compression, Song Han, Caffe 实现
  5. 【使用 arm-poky-linux-gnueabi-gcc -v 指令可以查看 gcc 版本时报错】
  6. 西门子PLC1200学习之进制的转换
  7. 正反馈、负反馈、电容器偶合、直偶、偏置
  8. Win7怎么安装?推荐3种Windows7安装方法
  9. SHA1加密技术文档说明
  10. java测试题一附答案,Java考试题30道(附答案)