Manjaro Setup

Related dotfiles can be found here

Screenshot

Environment

  • Machine: Macbook Pro 14 mid
  • System: Manjaro
  • Desktop: KDE Plasma 5
  • Window Manager: i3

Setup

Installation

Config

  1. References

  2. Display

    • Multi Screen Support: Install xrandr
    1. (If happens)Randomly freezing: Disable hardware acceleration

    2. Font in HDPI

      Linux 下终极字体配置方案

      • Make qt config persistent:
        • chmod u+w ~/.config/Trolltech.conf before running qtconfig-qt4
        • chmod -w ~/.config/Trolltech.conf after qtconfig-qt4 closed
    3. HDPI without DE

      Make sure you install the plasma-desktop package to config HDPI for QT Apps

      1. X Resources && GDK

        Follow HiDPI - ArchWiki

      2. QT

        1. Scale

          1
          export QT_AUTO_SCREEN_SCALE_FACTOR=1
        2. Font size

          Use "KDE System Settings" or edit the file manually to config ~/.config/kcmfonts

        3. Cursor size

          Add XCURSOR_PATH=/usr/share/icons to ENV. I put it in ~/.pam_environment.

  3. Keyboard & Touchpad

    1. Settings of touchpad and keyboard are reset after waking up from suspend

      touchpad settings are wrong after resuming from suspend

      Temporary solution: run scripts to reapply settings after waking up

      Using a script and an udev rule

      Add a executable script under /usr/lib/systemd/system-sleep. Env of DISPLAY and XDG_RUNTIME_DIR need to be set for X related settings to work in the script.

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      #/usr/lib/systemd/system-sleep/reapply-devices-settings.sh
      #!/bin/sh
      case $1/$2 in
      pre/*)
      # echo "Going to $2..."
      # Place your pre suspend commands here, or `exit 0` if no pre suspend action required
      exit 0
      ;;
      post/*)
      echo "Waking up from $2..."
      sleep 1
      # Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
      su {username} -c "DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/{user_id} kcminit kcm_touchpad"
      su {username} -c "DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/{user_id} systemctl --user restart laptop-keymap.service"
      esac
    2. Settings of touchpad and keyboard are reset after devices plugged in/out

      Temporary solution: run scripts to reapply settings once devices plugged in/out

      How to permanently assign a different keyboard layout to a USB keyboard

      Add /etc/udev/rules.d/00-usb-keyboard.rules as follows:

      1
      2
      3
      ATTRS{idVendor}=="feed", ATTRS{idProduct}=="1307", OWNER="sinkerine"
      ACTION=="add", RUN+="/home/sinkerine/.config/scripts/usb-keyboard-in_udev.sh"
      ACTION=="remove", RUN+="/home/sinkerine/.config/scripts/usb-keyboard-out_udev.sh"

      This script will be called every time devices plugged in/out(So I am not sure how the keyboard vendor and product works) Then create and maintain your hook scripts:

      /home/sinkerine/.config/scripts/usb-keyboard-in_udev.sh

      1
      2
      #!/bin/sh
      /home/sinkerine/.config/scripts/usb-keyboard-in.sh &

      /home/sinkerine/.config/scripts/usb-keyboard-in.sh

      1
      2
      3
      4
      5
      6
      7
      8
      #!/bin/sh
      if lsusb | grep -q -E 'feed.*(1307|6060)'; then
      su sinkerine -c "DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 systemctl --user stop laptop-keymap.service"
      else
      sleep 2
      kcm_init kcm_touchpad
      su sinkerine -c "DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 systemctl --user restart laptop-keymap.service"
      fi

      /home/sinkerine/.config/scripts/usb-keyboard-out_udev.sh

      1
      2
      #!/bin/sh
      /home/sinkerine/.config/scripts/usb-keyboard-out.sh &

      /home/sinkerine/.config/scripts/usb-keyboard-out.sh

      1
      2
      3
      4
      #!/bin/sh
      sleep 2
      lsusb | grep -q -E 'feed.*(1307|6060)' ||
      su sinkerine -c "DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 systemctl --user start laptop-keymap.service"
  4. Network

    • (Macbook Specific) WiFi : Install linux-headers broadcom-wl-dkms
  5. Desktop

    1. Compositing Effects(For window transparency, desktop effects...)

      Re-enabling compositing effects

      • Install compton
      • Launch compton with i3: add exec --no-startup-id compton to i3 config
    2. Failed to Suspend with USB Devices Connected

      Instantaneous wakeups from suspend

    3. High CPU usage of plasmashell

  6. Mount

    1. Mount NAS Samba Share Automatically

      • autofs
      • Add uid=<user_name> in cifs connection options to avoid permission issues.
  7. Power Management

    • Use powertop to monitor power usage
    1. 100.0% usage by Audio codec hwC0D0 Realtek

      Enable sound related power saving in tlp

Software

  • Terminal emulator: Alacritty
  • Drop-down terminal emulator: Guake
  • Text editor: Emacs
  • Launcher: Rofi
  • Browser: Firefox
  • Web services: Rambox
    • Development Documentations: DevDoc
    • Twitter: TweetDeck
    • Read later: Pocket
  • Input method: Fcitx
    • Chinese: fcitx-rime
    • Japanese: fcitx-mozc
  • Wine wrapper: CrossOver
  • Music ripper & tagger: Foobar2000(Wine)
  • Music player: Clementine