Moichi_木雨齐

文章 分类 评论
2 2 8

站点介绍

本人并非计算机或者软件之类的相关专业,用Arch只是作为日常使用,如果本站的某文对Arch相关的知识有错误的理解或说明,请把我的问题指出来,不要喷或歧视我

Wayfire及Awesome安装配置

Moichi Lin 2022-09-28 2315 8条评论 Arch_Linux

首页 / 正文
关于Arch Linux, 关于Wayfire, Wayland等 , 安装&配置

发布于2022-04-22

Wayfire

Wayfire is a wayland compositor based on wlroots. It aims to create a customizable, extendable and lightweight environment without sacrificing its appearance.
Wayfire是一个基于wlroots的wayland合成器。它旨在创建一个可定制的、可扩展的、轻量级的环境,且不牺牲其外观。
官网 Wayfire
Github Wayfire

我的dotfiles


连网

sudo systemctl enable --now NetworkManager
nmcli dev wifi list
nmcli dev wifi connect $WIFI-SSID password $WIFI-PASSWD 
nmcli dev wifi connect $WIFI-SSID password $WIFI-PASSWD hidden yes #连接隐藏wifi

0 开启 32 位支持库

sudo vim /etc/pacman.conf

去掉 [multilib] 一节中两行的注释,来开启 32 位库支持。


1 安装 yay

wget https://arch.moichi.cn/res/yay-bin.pkg.tar.zst
sudo pacman -U yay-bin.pkg.tar.zst

2 安装Wayfire

yay -S pango
yay -S wayfire
yay -S polkit

3 安装几个基础软件

yay -S qt5-wayland
yay -S xorg-xwayland                                                   #xwayland
sudo pacman -S ntfs-3g                                                 #识别NTFS格式的硬盘
sudo pacman -S adobe-source-han-serif-cn-fonts wqy-zenhei              #安装几个开源中文字体 一般装上文泉驿就能解决大多wine应用中文方块的问题
sudo pacman -S noto-fonts-cjk noto-fonts-emoji noto-fonts-extra        #安装谷歌开源字体及表情
sudo pacman -S firefox                                                 #安装火狐浏览器
sudo pacman -S ark p7zip unrar unarchiver lzop lrzip                   #解压工具
sudo pacman -S git wget kate bind                                      #一些工具
sudo pacman -S alsa-utils pulseaudio pulseaudio-alsa pavucontrol pulseaudio-bluetooth      #声音及音量控制
sudo pacman -S brightnessctl      #屏幕背光控制
yay -S wl-gammactl                #gamma,亮度,对比度
sudo pacman -S bluez bluez-utils bluez-libs bluez-qt bluez-tools blueman bluedevil  #蓝牙

4 几个刚需软件

yay -S kitty python-pillow      #kitty 在wayland下支持ranger预览文件
yay -S waybar     #bar
yay -S wofi       #wofi 作为一个程序检索和启动器
yay -S ranger ttf-nerd-fonts-symbols-1000-em-mono highlight atool   #终端文件管理器
yay -S swaylock   #锁屏
yay -S kanshi     #屏幕
yay -S swaybg     #壁纸
yay -S wpaperd    #壁纸。 可自动切换同路径下随机壁纸
yay -S mpvpaper   #视频壁纸
yay -S thunar gvfs gvfs-mtp   #文件管理器
yay -S thunar-archive-plugin file-roller 
yay -S wl-clipboard  #剪贴板 
yay -S wlogout    #wlogout 可用来帐户登出,关机重启等操作
yay -S grim slurp   #截图
yay -S mako       #通知
yay -S greetd greetd-tuigreet   #登录管理器

我的dotfiles

4.1 greetd配置

编缉 /etc/greetd/config.toml

[default_session]
command = "tuigreet --cmd wayfire"
user = "$USER"

4.2 kitty配置

cd ~/.config/kitty
ln -s ./kitty-themes/themes/Material.conf ~/.config/kitty/theme.conf

kitty.conf 里添加

include ./theme.conf

4.3 ranger配置

git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
echo "default_linemode devicons" >> $HOME/.config/ranger/rc.conf

5 安装输入法

sudo pacman -S fcitx5-im              #基础包组
sudo pacman -S fcitx5-chinese-addons  #官方中文输入引擎
sudo pacman -S fcitx5-material-color  #主题

5.1 设置环境变量

/etc/environment 加入以下内容

GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
INPUT_METHOD=fcitx
GLFW_IM_MODULE=ibus

6 显卡驱动

6.1 英特尔核芯显卡

sudo pacman -S mesa lib32-mesa vulkan-intel lib32-vulkan-intel

6.2 Nvidia显卡驱动

sudo pacman -S nvidia-settings nvidia-utils lib32-nvidia-utils nvidia-dkms nvidia-prime opencl-nvidia lib32-opencl-nvidia vulkan-headers vulkan-intel lib32-vulkan-intel vulkan-icd-loader lib32-vulkan-icd-loader cuda

6.3设置早期KMS启动并启用DRM

这一步你需要做两件事,添加内核参数和 initramfs 模块。

添加内核参数

修改 /etc/default/grub 找到 GRUB_CMDLINE_LINUX_DEFAULT这一项在后面加入 nvidia-drm.modeset=1

GRUB_CMDLINE_LINUX_DEFAULT="xxxx nvidia-drm.modeset=1”

更改完成后执行,下面命令,会重新生成grub.cfg。

sudo grub-mkconfig -o /boot/grub/grub.cfg

添加 initramfs 模块

/etc/mkinitcpio.conf 中找到 MODULES=这一行在括号的后面加入intel_agp i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm。

MODULES=(intel_agp i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)

别忘了重新生成一下 initramfs 执行

sudo mkinitcpio -P

6.4 创建nvidia hook

创建/etc/pacman.d/hooks/nvidia.hook 内容为

[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia-dkms
Target=linux-zen
# Change the linux part above and in the Exec line if a different kernel is used

[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'

7 其他软件

yay -S v2raya-bin v2ray  #v2raya
yay -S clash-premium-bin #clash
yay -S google-chrome gtk4 icalingua++ #chrome QQ
sudo pacman -S aria2  #aria2服务
sudo pacman -S mpv nomacs kate #视频播放 图片查看 文本编辑
yay -S gamemode steam lutris
yay -S vbam-wx fceux-git melonds-bin citra-qt-bin ffmpeg4.4 yuzu-mainline-bin #GBA FC NDS 3DS SWITCH 模拟器
yay -S mesen desmume-git #另可选FC和NDS模拟器 不推荐
yay -S retroarch retroarch-assets-ozone retroarch-assets-xmb libretro-nestopia-git libretro-vba-next-git libretro-desmume-git #retroarch 包含很多常见游戏平台的模拟器
sudo pacman -S virtualbox virtualbox-host-dkms virtualbox-guest-iso   #virtualbox
yay -S obs-studio wlrobs-hg  #OBS
sudo pacman -S refind  #引导工具
yay -S genymotion    #安卓环境基于vbox,建议添加arm_translation以支持arm转换
yay -S scrcpy        #投屏软件
yay -S android-tools #adb工具

arm_translation

7.1 Chrome wayland,不建议

sudo vim /usr/share/applications/google-chrome.desktop

--gtk-version=4 添加到每一个Exec的未尾
在chrome上打开chrome://flags
Preferred Ozone platform 换成 wayland
以支持fcitx5在chrome在wayland下运行

7.2 vbox配置

sudo usermod -a -G vboxusers $USER #vbox 启用USB

7.3 refind配置

refind-install                     #安装refind
sudo cp -r $theme /efi/EFI/refind/ #复制主题 推荐rEFInd-minimal
sudo su
echo 'include themes/rEFInd-minimal/theme.conf' >> /efi/EFI/refind/refind.conf #应用主题

7.4 aria2配置

编辑 aria2.service

sudo vim /etc/systemd/user/aria2.service
[Unit]
Description=Aria2 Daemon

[Service]
ExecStart=/usr/bin/aria2c --conf-path=/home/$username/.config/aria2/aria2.config

[Install]
WantedBy=default.target
touch ~/.config/aria2/aria2.session
vim ~/.config/aria2/aria2.config
systemctl --user enable --now aria2 #非root服务自启

config可以在网上找一份

7.5 V2raya

yay -S v2raya-bin v2ray
sudo systemctl enable --now v2raya #服务自启
Dashboard: 127.0.0.1:2017

7.6 Clash

yay -S clash_permium_bin
start with `clash`
如果country.mmdb下载失败, 手动复制
再配置自己的配置文件
cp $Country.mmdb /home/$username/.config/clash/
cp $ur_config.yaml /home/$username/.config/clash/

Country.mmdb

7.6.1 Clash分流配置

开启流量转发

sysctl -w net.ipv4.ip_forward=1

53端口可能被占用,先关掉默认系统DNS端口

systemctl disable systemd-resolved

配置config.yaml

port: 7890
socks-port: 7891
# Transparent proxy server port for Linux and macOS (Redirect TCP and TProxy UDP)
# redir-port: 7892
# Transparent proxy server port for Linux (TProxy TCP and TProxy UDP)
# tproxy-port: 7893
# HTTP(S) and SOCKS4(A)/SOCKS5 server on the same port
mixed-port: 7894
allow-lan: true
mode: Rule
log-level: info
external-controller: 127.0.0.1:9090

dns:
  enable: true
  listen: 0.0.0.0:53
  enhanced-mode: fake-ip
  nameserver:
    - 114.114.114.114
    - 8.8.8.8
  fallback:
    - 8.8.8.8

tun:
  enable: true
  stack: system # 或 gvisor
  dns-hijack:
    - any:53
    - tcp://any:53
  auto-route: true # auto set global route
  auto-detect-interface: true # conflict with interface-name
  
proxy-groups:
  - name: 🌏 Proxy
    type: select
    proxies:

  - name: 🐟 漏网之鱼
    type: select
    proxies:
      - DIRECT
      - 🔰 所有节点
      
  - name: 🌏 Google
    type: select
    proxies:
    
  - name: 🌏 Telegram
    type: select
    proxies:

  - name: 🎮 Steam
    type: select
    proxies:
      - DIRECT
      
  - name: 🌏 Tld-Not-CN
    type: select
    proxies:
      - DIRECT
      
  - name: 🇨🇳 国内网站
    type: select
    proxies:
      - DIRECT
      - 🌏 Proxy
      
  - name: 🔰 所有节点
    type: select
    proxies:
      - DIRECT

rule-providers:
  reject:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
    path: ./ruleset/reject.yaml
    interval: 86400

  icloud:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt"
    path: ./ruleset/icloud.yaml
    interval: 86400

  apple:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
    path: ./ruleset/apple.yaml
    interval: 86400

  google:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt"
    path: ./ruleset/google.yaml
    interval: 86400

  proxy:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
    path: ./ruleset/proxy.yaml
    interval: 86400

  direct:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
    path: ./ruleset/direct.yaml
    interval: 86400

  private:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
    path: ./ruleset/private.yaml
    interval: 86400

  gfw:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
    path: ./ruleset/gfw.yaml
    interval: 86400

  greatfire:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/greatfire.txt"
    path: ./ruleset/greatfire.yaml
    interval: 86400

  tld-not-cn:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt"
    path: ./ruleset/tld-not-cn.yaml
    interval: 86400

  telegramcidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
    path: ./ruleset/telegramcidr.yaml
    interval: 86400

  cncidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
    path: ./ruleset/cncidr.yaml
    interval: 86400

  lancidr:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
    path: ./ruleset/lancidr.yaml
    interval: 86400

  applications:
    type: http
    behavior: classical
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
    path: ./ruleset/applications.yaml
    interval: 86400


rules:
 - DOMAIN-SUFFIX,steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,steampipe.steamcontent.tnkjmec.com,🎮 Steam
 - DOMAIN-SUFFIX,st.dl.eccdnx.com,🎮 Steam
 - DOMAIN-SUFFIX,st.dl.bscstorage.net,🎮 Steam
 - DOMAIN-SUFFIX,st.dl.pinyuncloud.com,🎮 Steam
 - DOMAIN-SUFFIX,dl.steam.clngaa.com,🎮 Steam
 - DOMAIN-SUFFIX,cdn.mileweb.cs.steampowered.com.8686c.com,🎮 Steam
 - DOMAIN-SUFFIX,xz.pphimalayanrt.com,🎮 Steam
 - DOMAIN-SUFFIX,edge.steam-dns.top.comcast.net,🎮 Steam
 - DOMAIN-SUFFIX,edgecast.cdn.steampipe.steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,google.cdn.steampipe.steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,google2.cdn.steampipe.steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,level3.cdn.steampipe.steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,steam.eca.qtlglb.com,🎮 Steam
 - DOMAIN-SUFFIX,steam.naeu.qtlglb.com,🎮 Steam
 - DOMAIN-SUFFIX,steam.ru.qtlglb.com,🎮 Steam
 - DOMAIN-SUFFIX,steam.apac.qtlglb.com,🎮 Steam
 - DOMAIN-SUFFIX,steampipe-kr.akamaized.net,🎮 Steam
 - DOMAIN-SUFFIX,steampipe-partner.akamaized.net,🎮 Steam
 - DOMAIN-SUFFIX,steampipe.akamaized.net,🎮 Steam
 - DOMAIN-SUFFIX,f3b7q2p3.ssl.hwcdn.net,🎮 Steam
 - DOMAIN-SUFFIX,telus.cdn.steampipe.steamcontent.com,🎮 Steam
 - DOMAIN-SUFFIX,steam.cdn.on.net,🎮 Steam
 - DOMAIN-SUFFIX,steam.cdn.orcon.net.nz,🎮 Steam
 - DOMAIN-SUFFIX,steam.cdn.slingshot.co.nz,🎮 Steam
 - DOMAIN-SUFFIX,steam.cdn.webra.ru,🎮 Steam

 - DOMAIN,clash.razord.top,DIRECT
 - DOMAIN,yacd.haishan.me,DIRECT
 - RULE-SET,applications,DIRECT
 - RULE-SET,private,DIRECT
 - RULE-SET,reject,REJECT
 - RULE-SET,icloud,DIRECT
 - RULE-SET,apple,DIRECT
 - RULE-SET,google,🌏 Google
 - RULE-SET,proxy,🌏 Proxy
 - RULE-SET,gfw,🌏 Proxy
 - RULE-SET,greatfire,🌏 Proxy
 - RULE-SET,tld-not-cn,🌏 Tld-Not-CN
 - RULE-SET,direct,DIRECT
 - RULE-SET,lancidr,DIRECT
 - RULE-SET,cncidr,DIRECT
 - RULE-SET,telegramcidr,🌏 Telegram

 - MATCH,🐟 漏网之鱼

编辑 clash.service

sudo vim /etc/systemd/user/clash.service
[Unit]
Description=Clash daemon, A rule-based proxy in Go.
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/clash -d /home/$username/.config/clash

[Install]
WantedBy=default.target
systemctl --user enable --now clash #服务自启

Dashboard: https://clash.razord.top/

7.7 yuzu配置

运行yuzu需要key
把以下文件解压覆盖到
~/.local/share/yuzu/
YUZU_KEY

8 Waydroid (不推荐)

yay -S waydroid waydroid-image #waydroid
sudo waydroid init
sudo waydroid init -s GAPPS -f
systemctl start waydroid-container.service
waydroid session start 
waydroid show-full-ui
sudo mount --bind <source> ~/.local/share/waydroid/data/media/0/<target> #共享文件夹

Awesome

sudo pacman -S xorg-server xorg-xinit xterm 
yay -S awesome-git picom-git playerctl pamixer numlockx
echo "exec awesome" > ~/.xinitrc

启动时,需要在greetd里F2更改命令为startx



评论(8)

  1. f0 游客 2022-05-21 20:04 回复

    在添加 initramfs 模块时,我遇到一个报错

    ==> ERROR: module not found: `nvidia'
    ==> ERROR: module not found: `nvidia_modeset'
    ==> ERROR: module not found: `nvidia_uvm'
    ==> ERROR: module not found: `nvidia_drm''

    1. Moichi Lin 管理员 2022-09-13 09:21 回复

      @f0

      模块加错了地方,或者写错了

  2. printf 游客 2022-06-21 22:38 回复

    在de里wayland双显卡的切换如何实现

    1. Moichi Lin 管理员 2022-09-13 09:19 回复

      @printf

      intel和nvidia的话通过常用的optimus-manager实现不了,那个只在x11下运行,所以建议需要用到nvidia时,还是用prime-run吧,

  3. 383494 游客 2022-06-26 17:24 回复

    安装grimshot提示

    -> request failed: Get "https://aur.archlinux.org/rpc?arg%5B%5D=grimshot&type=info&v=5": proxyconnect tcp: tls: first record does not look like a TLS handshake

    1. Moichi Lin 管理员 2022-09-13 09:20 回复

      @383494

      网络问题,另外syu一下

  4. 1 游客 2022-09-12 23:13 回复

    yay -S ranger ttf-nerd-fonts-symbols-mono highlight atool #终端文件管理器

    ttf-nerd-fonts-symbols-mono这个没有

    1. Moichi Lin 管理员 2022-09-13 09:17 回复

      @1

      这个包这两天更新成了

      ttf-nerd-fonts-symbols-1000-em-mono

热门文章

最新评论

  • Moichi Lin

    @f0 模块加错了地方,或者写错了

  • Moichi Lin

    @383494 网络问题,另外syu一下

  • Moichi Lin

    @printf intel和nvidia的话通过常用的optimus-manager实现不了,那个只在x11下运行,所以建议需要用到nvidia时,还是用prime-run吧,

  • Moichi Lin

    @1 这个包这两天更新成了 ttf-nerd-fonts-symbols-1000-em-mono

  • 1

    yay -S ranger ttf-nerd-fonts-symbols-mono highlight atool #终端文件管理器 ttf-nerd-fonts-symbols-mono这个没有

  • 383494

    安装grimshot提示 -> request failed: Get "https://aur.archlinux.org/rpc?arg%5B%5D=grimshot&type=info&v=5": proxyconnect tcp: tls: first record does not look like a TLS handshake

  • printf

    在de里wayland双显卡的切换如何实现

  • f0

    在添加 initramfs 模块时,我遇到一个报错 ==> ERROR: module not found: `nvidia' ==> ERROR: module not found: `nvidia_modeset' ==> ERROR: module not found: `nvidia_uvm' ==> ERROR: module not found: `nvidia_drm''

日历

2022年10月

      1
2345678
9101112131415
16171819202122
23242526272829
3031     

标签云

友情链接

文章目录

推荐关键字:

站点公告
关于Arch Linux, 关于Wayfire, Wayland等 , 安装&配置
点击小铃铛关闭
配色方案