I3桌面

来自linux中国网wiki
跳到导航 跳到搜索


src

https://github.com/evan886/myi3

tasty

i3桌面好  电池不够会红提示 爽

ins


有空搞一下 有cokey 什么 的 更加 好用 
Fork 自 wmii 的窗口管理器

pkg install -y i3 i3lock i3status
pkg install dmenu
conky
echo "exec /usr/local/bin/i3" >> ~/.xinitrc


#on kali 
sudo apt install i3
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
将会同时安装下列软件:
  dex dunst i3-wm i3status libanyevent-i3-perl libanyevent-perl libasync-interrupt-perl libev-perl libguard-perl
  suckless-tools
建议安装:
  libevent-perl libio-async-perl libpoe-perl libtask-weaken-perl dwm stterm surf
下列【新】软件包将被安装:
  dex dunst i3 i3-wm i3status libanyevent-i3-perl libanyevent-perl libasync-interrupt-perl libev-perl libguard-perl
  suckless-tools
升级了 0 个软件包,新安装了 11 个软件包,要卸载 0 个软件包,有 1524 个软件包未被升级。
需要下载 1,928 kB 的归档。


trouble

搞这两个
如果在自启动添加双显示器大小

2.8. Resizing
The easiest way to resize a container is by using the mouse: Grab the border and move it to the wanted size.

You can also use [binding_modes] to define a mode for resizing via the keyboard. To see an example for this, look at the default config provided by i3.

这个已搞定
有时 mod+1 去的桌面是1 而不是web 1

1 and 1:web 不是同一个桌面,看一下要怎么合并 还是怎么

launcher

$mod+d

锁屏 i3lock

xautolock -time 10 -locker "i3lock -i '/home/evan/wallpaper/f.jpg'" &

usage

窗口左右 上下调换

 mod+shift +方向 

窗口调整

窗口移动

使用Mod键加J(左)K(上)L(下):(右)可以在窗口间移动,如果是多屏显示器,窗口的移动可以跨越桌面的(A屏幕的最后一个窗口衔接B屏幕的第一个窗口)
窗口移动与窗口拆分

把一个窗口全屏显示或者退出全屏,按 $mod+f


与窗口拆分


窗口布局有三种模式,可以使用Mod + E,S,W快速试一下,就能明白.

使用Mod + F全屏化,效果很不错,某些时段专注某件时的时候可以开启.

Mod + V垂直或Mod + H水平排列子窗口,对于某些用于监控,不需要太多操作的桌面,可以使用,效果如下:

调整窗口大小

#在kali上安装 并保存了最原始的配置和得到了这个 mod+r  and then  j k l  good 
#Note  先选中 对方  然后j k l 就是调整自己了
# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"





# resize window (you can also use the mouse for that)  mouse左键选中就可以操作了

同时按下mod键+r,左下角会有红色字体提示resize, 后面这个没效果 按下方向键或者hjkl查看窗口状况~esc退出调整。

在 i3 中移动窗口、调整大小 有时可以有时不可以 ?
按 mod+r (resize) 键进入 resize 模式。此时屏幕下方显示红色 resize 提示。按 esc/Enter 键退出。 j/k/l/; 调整窗口大小,认为合适后按“Enter”退出

在 resize 模式下按方向键调整窗口大小。右键增大左键缩小。注意此处并不是意味着按右键使窗口边界向右移。

在一般模式下按 mod+shift+ 方向键调整窗口位置。
$mod + Shift + J	窗口左移
$mod + Shift + K	窗口下移
$mod + Shift + L	窗口上移
$mod + Shift + :	窗口右移
$mod + Shift + SpaceBar	窗口在平铺式/浮动式转换

调整容器大小最简单的办法是用鼠标:拖拽边框到想要的大小。

你也可以定义快捷键来调整,可以看看这个例子,default config--由i3提供

浮动窗口及大小调整


浮动窗口是很有用的功能,可以更灵活的使用桌面,例如边看文档边记笔记的场景,非常好用,使用Mod+Shift+空格可以使当前激活窗口变成浮动窗口.

有时候窗口的大小不适合的时候,可以使用Mod+R进行窗口大小调整模式(普通布局的窗口也可以调整),鼠标选中窗口边界,移动便可以调整窗口尺寸,注意这里边界会比较难选中

移动一个window到另一个workspace


移动一个窗口到另一个工作空间,按$mod+Shift+目标工作区数字。跟切换workspaces时一样的情况,如果目标工作空间不存在,它将被创建。

布局

Mod e 默认正常分列
Mod w 标签式布局
Mod s 堆叠布局
Mod f 全屏当前窗口

Mod Shift Space 切换浮动/非浮动



# scratchpad 暂存器暂时消失和再现
bindsym $mod+m move scratchpad
bindsym $mod+o scratchpad show


# move focused window
bindsym $mod+Shift+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right



关闭窗口


$mod+Shift+q 来杀掉这个窗口

锁屏

命令行输入i3lock进入锁屏界面,需要输入用户密码解锁(可通过键位绑定快捷锁屏)

#lock screen
bindsym $mod+l exec i3lock

常用 关闭等等

重启i3 $mod+Shift+r

退出i3 $mod+shift+e

浮动模式
浮动模式是相对于平铺模式的。窗口的位置和大小不是由i3自动管理的,而是由你手工调整。使用这个模式有违于平铺模式,但是他对一些案例如"Save as"对话窗口,或者toolbar窗口(GIMP或类似的)是有用的。这些窗口通常会设置恰当的提示和默认情况下被打开于浮动模式。

你可以通过按$mod+Shift+space来切换一个窗口的浮动模式。通过鼠标拖动标题栏,你可以移动这个窗口,通过拖动边框,你可以调整窗口大小。


关键字$mod将当作已配置好的修饰键,修饰键默认为Alt键(Mod1),windows(Mod4)键也是一个受欢迎的替换方案

mod键+回车,打开新的终端。无聊的话可以打开无数个…

垂直分割窗口,在创建新窗口前按$mod+v,水平分割窗口,按$mod+h。

把一个窗口全屏显示或者退出全屏,按 $mod+f。



要改变i3的配置,复制 /etc/i3/config 到 ~/.i3/config并且用一个文本编辑器来编辑它(或者是复制到~/.config/i3/config,如果你喜欢XDG目录方案)

第一次启动i3时,i3会引导你创建一个配置文件,你可以告诉向导程序在配置文件里设置Alt(Mod1)或windows(Mod4)键作为辅助按键。当然,创建的配置文件会使用你当前键盘布局的键盘符号。要启动向导程序,请在终端输入命令i3-config-wizard。
 请确认你当前并没有~/.i3/config/。否则向导程序将会退出。

exit 
mod+shift+e
下载本配置文件并解压,将i3和i3status放于~/.config/目录,将Pictures(包含几张示例壁纸)放于当前用户家目录下(即~/下)。
https://github.com/levinit/i3wm-config/

auto run

设定开机啟动项
鼠标指针总处于忙碌状态
当启动了某些并不支持启动提醒的脚本或程序时,鼠标指针会逗留在忙碌状态六十秒左右。

为排除此现象,凡是 exec 命令都加 --no-startup-id 后缀,比如:

exec --no-startup-id  fcitx -r &



   exec /usr/local/bin/compton -CGb #设定透明化啟动
   exec /usr/local/bin/fcitx -r & #设定输入法啟动
   exec /usr/local/bin/feh --bg-scale  path/123.jpeg  #设定桌面背景

config

#evan
exec exec fcitx

bar

rofi

bindsym $mod+d exec --no-startup-id rofi -show drun


https://tunkshif.github.io/linux/i3-config.html

i3bar


后来用上自己home目录的相对文件了
默认的配置文件在这里 改一下 ,不要的注释
/usr/local/etc/i3status.conf

i3-gaps
sudo pkg install i3-gaps

bar {
    i3bar_command i3bar -t

i3的bar默认不支持透明度设置,而i3-gaps可以,需要启动i3bar时添加-t参数

在面板上当然需要各种状态信息,这类信息由一个专门的程序提供,用户可以选择默认的状态程序(i3status),也可以使用其他丰富多样的程序(i3block,condy等等).从原理上,状态程序负责每间隔一段时间标准输出一段字符串,而i3bar负责将其显示到面板中



指定输出位置,默认是全部显示器都有,单独设置可以启动多个不同的
output <output>
---
# big monitor: everything
bar {
    # The display is connected either via HDMI or via DisplayPort
    output HDMI2
    output DP2
    status_command i3status
}

# laptop monitor: bright colors and i3status with less modules.
bar {
    output LVDS1
    status_command i3status --config ~/.i3status-small.conf
    colors {
        background #000000
        statusline #ffffff
    }
}

安装使用配置 i3——i3bar

note

对于更高级的用户,i3 提供了完整的进程间通信(IPC)接口,允许您使用偏好的语言来开发脚本或程序,以实现更多的自定义选项。

i3 中还有另一种特殊类型的工作空间:the scratchpad(便笺簿)。它是一个不可见的工作区,通过按快捷方式显示在其他工作区的中间。这是一种访问您经常使用的窗口或程序的方便方式,如电子邮件客户端或音乐播放器。

双显示器

https://bryceyang.github.io/use-external-display-on-i3wm/

https://blog.csdn.net/yaakire/article/details/78932593

原始文件

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec i3-sensible-terminal

# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3status
}

see also

译 i3 Tiling Window Manager/ i3 平铺式窗口管理器 https://github.com/levinit/i3wm-config

i3窗口管理器的一些配置


good 桌面环境微科普与 i3 配置记录

Archlinux下i3wm与urxvt的配置

linux窗口管理器-i3wm-使用及快捷键 https://www.v2ex.com/t/51359

https://www.jianshu.com/p/b9b644cf528f

http://bbs.chinaunix.net/thread-4180791-1-1.html

https://www.jianshu.com/p/9717322753fc

https://wiki.archlinux.org/index.php/I3_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E4%B8%BB%E9%A2%98%E4%B8%8E%E9%85%8D%E8%89%B2%E6%96%B9%E6%A1%88

https://github.com/levinit/i3wm-config/#%E6%89%98%E7%9B%98%E5%9B%BE%E6%A0%87

Linux I3窗口管理器调整优化

(菜鸟玩linux)ubuntu的i3wm顶行显示各种参数


i3 窗口管理器使 Linux 更美好

debian使用i3教程:从0开始

i3初步使用

i3使用进阶

各种桌面的配置