Skip to content

Instantly share code, notes, and snippets.

@SAW4
Last active August 21, 2017 21:30
Show Gist options
  • Save SAW4/58121cc4a2205956dd469ac5dbb72fb1 to your computer and use it in GitHub Desktop.
Save SAW4/58121cc4a2205956dd469ac5dbb72fb1 to your computer and use it in GitHub Desktop.
Trivia collection about linux (help you setup/config linux)

Linux Trivia

  • 開機時,在bootloader加載後螢幕有一下「閃動」,個人猜想其實是backlight被快速地調至最亮然後又調回先前亮度所產生的一種「錯覺」。

    • 這有可能是late KMS start + framebuffer(vesafb)的副作用,解決方案有兩個:
      1. 放棄grub2 framebuffer,意味著色彩,主題,都不能使用;可以在kernel param上加上GRUB_TERMINAL_OUTPUT=console
      2. 啟用early KMS start,在/etc/mkinitcpio.conf作以下修改:
        ...
        MODULES="crc32 i915 libcrc32c crc32c_generic ..." #加入i915到MODULES
        ...
        
        然後重新build initrd, mkinitcpio -p linux-lts
  • sddm的avator是blur的,或者說解像度有點低[版本 0.14.0-2]

    • 安裝sddm-git可以解決(?) 當時我是從aur安裝較舊的version [版本 0.13.0.10.gf19e0f3-1]
  • sddm解像度過高/低,自定義解像度的方法

    • /etc/X11/xorg.conf.d/新建檔案30-monitor.conf,內容如下:

      Section "Monitor"
            Identifier   "eDP1"
            Option "Enable" "true"
            Option "PreferredMode" "1600x900"
      EndSection
      
  • zsh中文亂碼 及 konsole使用fcitx

    • 加入以下內容到.zshrc:
      export XIM_PROGRAM=fcitx
      export XIM=fcitx
      export GTK_IM_MODULE=fcitx
      export QT_IM_MODULE=fcitx
      export XMODIFIERS="@im=fcitx"
      export LC_ALL=en_US.UTF-8
      export LANG=en_US.UTF-8
      
  • 在suspend前啟動plasma screen locker
    新增這個文件:
    vim /etc/systemd/system/[email protected]
    內容如下:

    [Unit]                                                                                                                                                                                          
    Description=User suspend actions
    Before=sleep.target      
    
    [Service]                
    User=%I                  
    Type=forking             
    Environment=DISPLAY=:0   
    ExecStartPre=/home/sawa/Scripts/pre_suspend_event
    ExecStart=/usr/bin/sleep 2
    
    [Install]                
    WantedBy=sleep.target 
    

    以及這個文件: vim /home/sawa/Scripts/pre_suspend_event

    #!/bin/bash
    export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus 
    qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock                                         
    
  • 鍵盤輸入Delay
      如果使用非DE環境時(比如awesome,i3),在打字時有可能會覺得有延遲,解決方法:
      xset r rate 660 30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment