manjaro i3wm 簡單配置(后續待更新……)


manjaro i3wm 配置美化


入了i3wm的坑,浪費時間


更改國內源

sudo pacman-mirrors -i -c China -m rank

修改/etc/pacman.conf

在文件末尾加上163鏡像源

[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = http://mirrors.163.com/archlinux-cn/$arch

之后執行安裝archlinuxcn-keyring

輸入法

sudo pacman -S fcitx fcitx-im fcitx-configtool fcitx-googlepinyin

vim ~/.xprofile

export GTK_IM_MODULE=fcitx 
export QT_IM_MODULE=fcitx 
export XMODIFIERS="@im=fcitx"

終端運行fcitx就可以設置輸入法了

zsh 配置

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

ZSH_THEME="steeef"

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

plugins=(
	git
	zsh-autosuggestions
	zsh-syntax-highlighting
	z
)

解決蜂鳴聲

sudo vim /etc/inputrc

set bell-style none前面的注釋符號去掉

簡單的自定義 i3wm 的配置文件

原有的配置文件首先進行備份~/.i3/config,然后在該配置文件末尾加上下面的語句

注意自定義的語句有些和默認配置沖突,要把默認配置修改一下

#########################################################
#               my configuration                        #
#########################################################

# terminator
bindsym $mod+Return exec terminator

# fcitx 
exec_always --no-startup-id fcitx

# browser
bindsym $mod+F2 exec google-chrome-stable

# xrandr 配置顯示器
exec xrandr --output HDMI1 --auto --output LVDS1 --off

manjaro i3wm 自帶了一個截圖軟件scrot,可以不用下載其他的截圖軟件了,只不過它的配置我依然沒有成功……


關於feh配置背景不生效的問題

有一個現象:使用feh配置了桌面背景,但是每次開機啟動還是顯示默認的桌面背景。
在查看.i3/config后可知,manjaro-i3 默認使用nitrogen來管理桌面背景的,為了省事,我就直接把feh給刪除了,使用系統自帶的工具。nitrogen的配置文件可以在.config/nitrogen目錄中。

[xin_-1]                                                                                   
# file=/usr/share/backgrounds/i3_default_background.jpg                                    
file=/home/chaos/Pictures/wallpaper/1.jpg                                                  
mode=5                                                                                     
bgcolor=#002A36

修改bg-saved.cfg就可以了。


關於設置雙屏幕顯示的一些說明

首先要使用xrandr命令查看顯示器參數,根據實際情況修改

  • 打開外接顯示器,雙屏幕顯示相同的內容--克隆,(auto為最高分辨率)
xrandr --output HDMI-1 --same-as DVI-D-1 --auto
  • 若要指定外接顯示器的分辨率可以使用下面的命令(1280*1024):
xrandr --output HDMI-1 --same-as DVI-D-1 --mode 1280x1024
  • 打開外接顯示器,設置為右側擴展
xrandr --output HDMI-1 --right-of DVI-D-1 --auto
  • 關閉顯示器
xrandr --output DVI-D-1 --off
  • 打開HDMI-1接口顯示器,關閉DVI-D-1接口顯示器
xrandr --output HDMI-1 --auto --output DVI-D-1 --off
  • 設置主屏幕
xrandr --output HDMI-0 --primary
  • arandr

下載 arandr 這個軟件可以圖形界面設置多屏


rofi的配置

rofi的配置參考了(https://www.cnblogs.com/siyingcheng/p/11706215.html)
rofi和dmenu都是程序啟動器,我在配置文件里保留了默認的dmenu,只是另外賦予了一個快捷鍵

  1. 首先下載並生成自定義配置文件
sudo pacman -S rofi
mkdir -p ~/.config/rofi
rofi -dump-config > ~/.config/rofi/config.rasi
  1. 編輯配置文件(這是我的配置)
configuration {
        /*本行是指,rofi默認啟動的mode ???*/
	modi: "window,run,ssh,drun,combi";
        /*展示圖標*/
	show-icons: true;
        /*展示的圖標主題,這里要配置一下,可以從/usr/share/icons/目錄下copy圖標主題到~/.icons或者~/.local/share/icons/目錄下*/
	icon-theme: "Papirus-Dark-Maia";
	font: "Hack Nerd Font Mono Regular 13";
}
  1. 編輯.i3/config文件
# start program launcher
bindsym $mod+d exec --no-startup-id rofi -show drun -theme Adapta-Nokto
bindsym $mod+Shift+d exec --no-startup-id dmenu_recency
  1. rofi默認是帶有幾個主題的,主題目錄在/usr/share/rofi/themes/,也可以直接使用命令rofi-theme-selector來選擇,最簡單的就是直接在.i3/config配置文件中直接指定,就像我的這個一樣

ranger的配置

ranger是一個終端文件管理器,可以在終端中很方便的管理文件和目錄,我只想在終端里顯示圖片和高亮一些文件
復雜的用法可以參考以下博客:
(http://www.huangpan.net/posts/ji-ke/2019-08-21-ranger.html)
(https://www.52gvim.com/post/ranger-tool-usage)

  1. 創建配置文件,會在home目錄下的.config/ranger里生成幾個配置文件,類似下面的樣子
ranger --copy-config=all
creating: /Users/test/.config/ranger/rifle.conf    # 指定不同類型的文件的默認打開程序
creating: /Users/test/.config/ranger/commands.py    # 能通過 : 執行的命令
creating: /Users/test/.config/ranger/commands_full.py    # 能通過 : 執行的命令,但這個更全
creating: /Users/test/.config/ranger/rc.conf    # 選項設置和快捷鍵
creating: /Users/test/.config/ranger/scope.sh    # 當 use_preview_script = true,這個腳本會被調用
  1. 下載一些必須的插件
w3m      # 預覽網頁
highlight      # 高亮
atool      # 壓縮

  1. 簡單配置,修改rc.conf文件
set use_preview_script true    # 顯示簡單的文本文件或者圖片的預覽

set preview_script ~/.config/ranger/scope.sh    # 為其它預覽功能指定腳本文件

set preview_images true    # 預覽圖片

set preview_images_method w3m    # 使用什么方法來預覽圖片

set vcs_aware true    # 開啟 svn、git 之類的工具
  1. 在ranger中顯示的文件類型圖標
# 需要配置nerd系列字體
# https://github.com/alexanderjeurissen/ranger_devicons
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons

# 配置文件
echo "default_linemode devicons" >> $HOME/.config/ranger/rc.conf

wps for linux 無法使用fcitx輸入法的問題

這個問題在manjaro中沒有發現,但是在ubuntu里出現了這種情況,解決辦法如下:

# 修改 /usr/bin/wps /usr/bin/et /usr/bin/wpp

$ sudo vi /usr/bin/wps

export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE="fcitx"

gOpt=
#gOptExt=-multiply
gTemplateExt=("wpt" "dot" "dotx")

后續繼續,現在我也不會配置了……


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM