GW2: Desktop

Posted on Tue 24 September 2019 in linux

G W 2

Overview

  • wm: dwm
  • terminal: kitty OR st
  • app launcher: dmenu
  • browser: firefox
  • sh: zsh
  • editor: nvim OR vim
  • image viewer: feh
  • IME: libpinyin-fcitx4 OR fcitx5 rime

Breakdown

Xorg

In make.conf : VIDEO_CARDS='intel' INPUT_DEVICES='libinput'

Emerge xorg-server (of i965 drivers) and all the deps.

And emerge xsetroot, xmodmap, xrandr, setxkbmap, inconsolata, source-han-sans.

Before xmodmap keys, xmodmap -pke > default to save up the default mapping.

Screensaver

Emerge x11-libs/libXScrnSaver first

Build this simple C applet as, say, xidle:

#include<stdio.h>
#include<X11/extensions/scrnsaver.h>
int main() {
    XScreenSaverInfo *info = XScreenSaverAllocInfo();
    Display *dpy = XOpenDisplay(0);
    if(!info || !dpy ||
    !XScreenSaverQueryInfo(dpy, RootWindow(dpy,DefaultScreen(dpy)), info)) return -1;
    printf("%ld", info->idle / 1000); // sec
    XFree(info);
    XCloseDisplay(dpy);
    return 0;
}

Suckless family

Clone the source codes and well patch/test before commiting final full patches into /etc/portage/patches. Patch is good enough, no much need for savedconfig.

  • common: font, font size, xinerama USE
  • dwm: the "meta" key, pertag
  • st: colorscheme, zoom, scroll

If pixelsize=14 invalid in st's font setting, try size=14

For intuitive usage intro on dwm, read http://ratfactor.com/slackware/dwm/ and http://ratfactor.com/slackware/dwm2

To make st look (un)fancy, go to https://ciembor.github.io/4bit

Gtk+ w/o dbus

  • Follow this simple instruction: https://forums.gentoo.org/viewtopic-t-1103236.html
  • Atoms in /etc/portage/profile/package.provided are considered as already installed, so as to suppress emerge from installing them.
  • The line numbers in the diff patch might vary with different versions, so generate one from a real diff call.
  • After putting everything in place, go to the ebuild repo and run ebuild <P>.ebuild prepare to see if the patch works!!
  • Sometimes patches don't work due to an erroneous umask...
  • A better patch is to add the accessibility USE

Firefox

Global scaling by layout.css.devPixelsPerPx in about:config.

To get audio with PulseAudio, check pacmd's sinks.

Wine

symlink fonts under .wine/drive_c/windows/Fonts and improve font by regedit following archwiki

winetricks : install (3) DLL files of rich*

citrix

export ICAROOT=/opt/Citrix/ICAClient

cd $icaclient

./wfica -file /path/to/foo.ica

IME fcitx 4

Emerge fcitx-libpinyin, and configure.

Custom configuration can be done by editing files under $HOME/.config/fcitx. For instance, to enable pinyin IME (or any other IME), modify EnabledIMList in $HOME/.config/fcitx/profile.

Copy the codes that import the dbus-launch xinitrc.d script ( eval "$(dbus-launch --sh-syntax --exit-with-x11)" ) from /etc/X11/xinit/xinitrc to $HOME/.xinitrc, if userland .xinitrc is used by startx.

Key remapping by xmodmap may be overwritten by fcitx, as said in the official wiki. There is also a github issue related to it. To solve it, write xmodmap rules in $HOME/.Xmodmap and fcitx will load them at startup.

IME fcitx 5

fcitx:5, fcitx-rime:5, fcitx-qt:5, fcitx-gtk:5, (fcitx-configtool:5)

run fcitx5 as daemon or fcitx-configtool trigger

CONF_DIR: .config/ibus/rime OR .local/share/fcitx5/rime

  • default.custom.yaml : main, patch
  • wongdean/rime-settings
  • rime_deployer --build CONF_DIR /usr/share/rime-data CONF_DIR/build

sway

USE libinput pulseaudio wayland -X

sys-auth/seatd USE server ; boot, group

gui-libs/wlroots , media-libs/mesa USE vulkan ; WLR_RENDERER=vulkan

sway alacritty tmux google-chrome OR firefox-bin

.config/xkb/symbols/custom https://wiki.archlinux.org/title/Sway#Change_modifier_to_CapsLock_and_keep_Super

.config/sway/config

  • input * xkb_layout custom
  • set $mod Mod4
  • set $term alacritty
  • bindsym $mod+Shift+Return exec $term
  • bindsym $mod+Shift+c kill
  • floating_modifier $mod normal
  • hide_edge_borders smart_no_gaps
  • workspace_auto_back_and_forth yes

https://www.dwarmstrong.org/sway/

PipeWire

media-video/pipewire USE dbus sound-server

emerge media-video/wireplumber

usermod -aG pipewire larry (/dev/snd char devices group pipewire, usermod -rG audio larry)

cp /usr/share/pipewire/pipewire.conf ~/.config/pipewire/pipewire.conf

INIT gentoo-pipewire-launcher

qemu

USE fuse io-uring iscsi spice gtk; TARGETS

  • -enable-kvm -cpu host -smp 2 -m 1024M
  • -device virtio-net,netdev=vmnic,mac=12:34:12:34:12:34 -netdev user,id=vmnic,hostfwd=tcp:127.0.0.1:9001-:22
  • -drive file=/path/to/x.iso,media=cdrom -boot d
  • -display gtk -vga std

gw