eubnara / troubleshooting

이것저것 공부하다가 맞닥뜨리는 문제점, 해결방식 등 정리
2 stars 0 forks source link

Linux common settings #33

Open eubnara opened 4 years ago

eubnara commented 4 years ago

.bashrc

export PS1="\[\033[01;34m\]\W\[\033[00m\]\$(__git_ps1) \$ "
eubnara commented 4 years ago

.vimrc

set nocompatible " 오리지날 VI와 호환하지 않음
set wrap
set nowrapscan " 검색할 때 문서의 끝에서 처음으로 안돌아감
set nobackup " 백업 파일을 안만듬
set visualbell " 키를 잘못눌렀을 때 화면 프레시
set ruler " 화면 우측 하단에 현재 커서의 위치(줄,칸) 표시
set shiftwidth=4 " 자동 들여쓰기 4칸
" set number " 행번호 표시, set nu 도 가능
set fencs=ucs-bom,utf-8,euc-kr.latin1 " 한글 파일은 euc-kr로, 유니코드는 유니코드로
set fileencoding=utf-8 " 파일저장인코딩
set tenc=utf-8      " 터미널 인코딩
set expandtab " 탭대신 스페이스
set hlsearch " 검색어 강조, set hls 도 가능
set ignorecase " 검색시 대소문자 무시, set ic 도 가능
set tabstop=4 "  탭을 4칸으로
set lbr
set incsearch "  키워드 입력시 점진적 검색
syntax on "  구문강조 사용
set background=dark " 하이라이팅 light / dark
colorscheme desert  "  vi 색상 테마 설정
set backspace=eol,start,indent "  줄의 끝, 시작, 들여쓰기에서 백스페이스시 이전줄로
set history=1000 "  vi 편집기록 기억갯수 .viminfo에 기록
set mouse-=a
eubnara commented 4 years ago

git

git config --global core.editor "vim"
git config --global credential.helper "cache --36000"
eubnara commented 4 years ago

virtualbox 구동 후 usb 인식 안될 때

https://stackoverflow.com/questions/20021300/how-to-recognize-usb-devices-in-virtualbox-running-on-a-linux-host

sudo adduser $USER vboxusers
eubnara commented 4 years ago

disable touchpad right click zone

kubuntu 시스템 설정에서 올바르게 변경되지 않았다.

https://wdullaer.com/blog/2015/12/19/disable-right-click-zone-in-linux-on-a-synaptics-touchpad/ 을 참고하여 변경함

eubnara commented 4 years ago

40%, 80% 배터리 알림

https://blog.rahidelvi.ca/battery-level-notifications-for-ubuntu#the-script

#!/bin/bash

## Tutorial on battery level notifications (askubuntu.com/a/518955/60869)

while true
do                                                                                                                             
    export DISPLAY=:0.0
    # when using dual display, output has multiple lines.
    #battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)' | sort -n | tail -n 1`                                                             
    # https://askubuntu.com/questions/69556/how-do-i-check-the-batterys-status-via-the-terminal
    battery_level=`cat /sys/class/power_supply/BAT1/capacity`
    if on_ac_power; then                                                                                                       
        if [ $battery_level -ge 80 ]; then                                                                                     
            #notify-send "You can unplug the AC adapter. The battery is charging above 80%." "Charging: ${battery_level}% "    
            kdialog --title 'Battery high' --passivepopup "You can unplug the AC adapter. The battery is charging above 80%."  
            sleep 40                                                                                                           
            if on_ac_power; then                                                                                               
                #gnome-screensaver-command -l   ## lock the screen if you don't unplug AC adapter after 40 seconds             
                # on kde: https://www.reddit.com/r/kde/comments/av3riz/command_to_lock_the_screen/                             
                qdbus org.kde.ksmserver /ScreenSaver org.freedesktop.ScreenSaver.Lock                                          
            fi                                                                                                                 
         fi                                                                                                                    
    else                                                                                                                       
         if [ $battery_level -le 40 ]; then                                                                                    
            #notify-send "It's time to plug in the AC adapter! Battery charge is lower than 40%." "Charging: ${battery_level}%"
            kdialog --title 'Battery low' --passivepopup "It's time to plug in the AC adapter! Battery charge is lower than 40%."                                                                                                                             
            sleep 40                                                                                                           
            if ! on_ac_power; then                                                                                             
                #gnome-screensaver-command -l   ## lock the screen if you don't plug AC adapter after 40 seconds               
                # on kde: https://www.reddit.com/r/kde/comments/av3riz/command_to_lock_the_screen/                             
                qdbus org.kde.ksmserver /ScreenSaver org.freedesktop.ScreenSaver.Lock                                          
            fi                                                                                                                 
         fi                                                                                                                    
    fi                                                                                                                         

    sleep 300 # 300 seconds or 5 minutes                                                                                       
done   
eubnara commented 4 years ago

GIT_ASKPASS 환경변수 설정하여 kde wallet 으로 git credential 사용

https://wiki.archlinux.org/index.php/KDE_Wallet#Using_the_KDE_Wallet_to_store_Git_credentials

스크립트 실행권한 주지 않으면 시작할 때마다 암호를 입력해야 하는 경우 발견

eubnara commented 4 years ago

change caps lock to tilde

~ $ cat ~/.Xmodmap 
clear lock
keycode 66 = grave asciitilde grave asciitilde
~ $ xmodmap ~/.Xmodmap

pgup -> home, pagdn -> end

keycode 110 = Home
keycode 115 = End
keycode 112 = Home
keycode 117 = End
eubnara commented 4 years ago

gui 에서 키보드 지연율 세팅이 잘 안될 때,

xset r rate 300 40

https://superuser.com/questions/95368/increasing-keyboard-repeat-rate-in-kde

eubnara commented 4 years ago

kwin 세팅 kwin_20200610.txt shortcut_20220209.kksrc.txt

eubnara commented 4 years ago

gnome-keyring 세팅

kde 에서 visual code github authentication 을 하기 위해서 설치 필요

https://github.com/microsoft/vscode-docker/issues/1515

https://stackoverflow.com/questions/63107939/visual-studio-code-asking-to-authenticate-default-keyring-everytime-i-start vscode 켤때마다 gnome-keyring lock 풀기 위해 암호 입력하는데, SDDM 로그인 후에 이를 자동으로 되게 하려면 /etc/pam.d/sddm 파일을 일부 수정한다.

- - session optional       pam_gnome_keyring.so auto_start
+ session optional       pam_gnome_keyring.so auto_start
eubnara commented 4 years ago

터치패드로 가상 윈도우(workspace) 전환하고 싶을 때

wayland

Xorg

libinput-gestures 를 설치한다. https://github.com/bulletmark/libinput-gestures

나는 가로로 workspace 4개만 두어 사용한다. 아래 설정 후엔 좌우로 4손가락 swipe 로 이동 가능

$ cat ~/.config/libinput-gestures.conf 
gesture swipe left  4 _internal --cols 4 ws_left
gesture swipe right  4 _internal --cols 4 ws_right
gesture swipe left      xdotool key alt+Right
gesture swipe right     xdotool key alt+Left
gesture swipe up        xdotool key super+shift+d
gesture swipe down      xdotool key super+shift+d
gesture swipe up      4  xdotool key super+ctrl+shift+d
gesture swipe down    4  xdotool key super+ctrl+shift+d

그외 설정은 https://github.com/eubnara/troubleshooting/issues/33#issuecomment-641691168 에 설정한 kwin 단축키와 관련있음.

touchegg

https://github.com/JoseExposito/touchegg

touchegg 가 많이 개선된 것 같다.

~/.config/touchegg/touchegg.conf

<touchégg>

  <settings>
    <!--
      Delay, in milliseconds, since the gesture starts before the animation is displayed.
      Default: 150ms if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that no animation is
      displayed if you complete the action quick enough. This property configures that time.
    -->
    <property name="animation_delay">150</property>

    <!--
      Percentage of the animation to be completed to apply the action.
      Default: 20% if this property is not set.
      Example: Use the MAXIMIZE_RESTORE_WINDOW action. You will notice that, even if the
      animation is displayed, the action is not executed if you did not moved your fingers far
      enough. This property configures the percentage of the animation that must be reached to
      execute the action.
    -->
    <property name="action_execute_threshold">5</property>

    <!--
      Global animation colors can be configured to match your system colors using HEX notation:

        <color>909090</color>
        <borderColor>FFFFFF</borderColor>

      You can also use auto:

        <property name="color">auto</property>
        <property name="borderColor">auto</property>

      Notice that you can override an specific animation color.
    -->
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>

  <!--
    Configuration for every application.
  -->
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="UP">

      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L+Shift_L</modifiers>
        <keys>d</keys>
        <on>begin</on>
      </action>
<!--
      <action type="MAXIMIZE_RESTORE_WINDOW">
        <animate>true</animate>
      </action>
-->
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="DOWN">

      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L+Shift_L</modifiers>
        <keys>d</keys>
        <on>begin</on>
      </action>
<!--
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
-->
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="UP">

      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L+Shift_L+Control_L</modifiers>
        <keys>d</keys>
        <on>begin</on>
      </action>
<!--
      <action type="MAXIMIZE_RESTORE_WINDOW">
        <animate>true</animate>
      </action>
-->
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="DOWN">

      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L+Shift_L+Control_L</modifiers>
        <keys>d</keys>
        <on>begin</on>
      </action>
<!--
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
-->
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="LEFT">
      <action type="TILE_WINDOW">
        <direction>left</direction>
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="RIGHT">
      <action type="TILE_WINDOW">
        <direction>right</direction>
        <animate>true</animate>
      </action>
    </gesture>

<!--
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW">
        <animate>true</animate>
        <color>F84A53</color>
        <borderColor>F84A53</borderColor>
      </action>
    </gesture>
-->

    <gesture type="SWIPE" fingers="4" direction="LEFT">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="4" direction="RIGHT">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="3" direction="OUT">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>

<!--
    <gesture type="PINCH" fingers="4" direction="IN">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>A</keys>
        <on>begin</on>
      </action>
    </gesture>
-->
  </application>

  <!--
    Configuration for specific applications.
  -->

  <application name="Google-chrome,Chromium-browser,Firefox">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>

    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="LEFT">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Alt_L</modifiers>
        <keys>Right</keys>
        <on>begin</on>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="RIGHT">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Alt_L</modifiers>
        <keys>Left</keys>
        <on>begin</on>
      </action>
    </gesture>

  </application>

</touchégg>
eubnara commented 4 years ago

tlp 설치하기

https://linrunner.de/tlp/

eubnara commented 3 years ago

https://github.com/gnome-terminator/terminator/blob/master/INSTALL.md

terminator 설치, terminator-themes 설치

https://github.com/EliverLara/terminator-themes

https://terminator-gtk3.readthedocs.io/en/latest/plugins.html#creating-your-own-plugins

UI 에서도 설정 가능하다. 다음은 참고용

$ cat ~/.config/terminator/config
[global_config]
  title_hide_sizetext = True
  inactive_color_offset = 0.8050847457627118
  enabled_plugins = LaunchpadBugURLHandler, LaunchpadCodeURLHandler, APTURLHandler, TerminatorThemes
  title_font = Noto Mono 12
[keybindings]
  next_tab = <Shift>Right
  prev_tab = <Shift>Left
[profiles]
  [[default]]
    background_color = "#1f2d2d"
    background_darkness = 0.9
    cursor_color = "#ffffff"
    cursor_color_fg = False
    font = Noto Mono 12
    foreground_color = "#ffffff"
    show_titlebar = False
    scrollback_lines = 1000
    palette = "#2e3436:#ffb0b0:#c8ff9b:#fffca4:#6f9ceb:#9395d3:#bdeaff:#d3d7cf:#555753:#ffb0b0:#c8ff9b:#fffca4:#6f9ceb:#9395d3:#bdeaff:#eeeeec"
    use_system_font = False
[layouts]
  [[default]]
    [[[window0]]]
      type = Window
      parent = ""
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
[plugins]

탭사이즈 줄이기 gtk.css 를 이용한다.

https://wiki.archlinux.org/index.php/Terminator#GTK.2B_customization http://blog.nabam.net/workstation/2017/09/15/terminator_tabs/

~/.config/gtk-3.0/gtk.css
.terminator-terminal-window notebook tab {
    background-color: #222;
    padding: 0.2em;
    border: 0;
    border-color: #444;
    border-style: solid;
    border-width: 1px;
}

.terminator-terminal-window notebook tab:checked {
    background-color: #000;
    background-image: none;
}

.terminator-terminal-window notebook tab label {
    color: #ddd;
}

.terminator-terminal-window notebook tab:checked label {
    color: #76C802;
    font-weight: 500;
}

.terminator-terminal-window notebook tab button {
    padding: 0;
    background-color: transparent;
    color: #ccc;
}

.terminator-terminal-window notebook header {
    background-color: #444;
}

.terminator-terminal-window notebook tab button:hover {
  border: 0;
  background-image: none;
  border-color: #444;
  border-style: solid;
  border-width: 1px;
}

dolphin 에 여기서 터미네이터 열기 하는 방법 https://archived.forum.manjaro.org/t/open-terminator-here-at-dolphin-context-actions-menu/94577

$ cat ~/.local/share/kservices5/ServiceMenus/terminator-here.desktop
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;
Actions=openTerminatorHere;
X-KDE-AuthorizeAction=shell_access

[Desktop Action openTerminatorHere]
TryExec=terminator
Exec=terminator --working-directory %f
Icon=terminator

Name=Open Terminator Here

Comment=Opens Terminator at the current folder
eubnara commented 3 years ago
# for video preview thumbnail on dolphin
sudo apt install ffmpegthumbs
eubnara commented 3 years ago

https://github.com/pimlie/ubuntu-mainline-kernel.sh 최신 amd 지원을 위해 커널 업데이트

참고: https://github.com/eubnara/troubleshooting/issues/38

eubnara commented 3 years ago

disk 퍼포먼스 측정

gnome-disk-utility 사용

sudo apt install gnome-disk-utility

KDiskMark 라는 프로그램 대안이 있고 discover (둘러보기) 에서 설치가 가능하다. 하지만 20210327 기준 mount 된 드라이브에 대해서 벤치마크 테스트 불가능하다. (e.g. usb drive) https://github.com/JonMagon/KDiskMark/releases 에서 2.2.0 버전 동작 확인했다. 둘러보기에서 받으면 2.1.1 버전이 있고 usb mount 디렉터리 선택이 불가능하다. 그런데 무언가 불안정한 것 같다. random read, write 에 대해서 잘 안된다.

eubnara commented 3 years ago

설치할 프로그램

eubnara commented 3 years ago

firefox

마우스 더블클릭시 dash, dot 도 포함해서 블럭지정하기

https://support.mozilla.org/en-US/questions/1177220 about:config => layout.word_select.stop_at_punctuation = true

window 별 줌레벨 설정하기

https://support.mozilla.org/en-US/questions/681298 about:config => browser.zoom.siteSpecific=false

eubnara commented 3 years ago

starship cross shell prompt

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

https://starship.rs/

agave nerd font 괜찮았음

https://www.nerdfonts.com/font-downloads

eubnara commented 3 years ago

stacer

https://oguzhaninan.github.io/Stacer-Web/

https://youtu.be/6chA0L_AT6k?t=537

eubnara commented 3 years ago

nvidia driver 설치 참고

https://www.youtube.com/watch?v=LqFRNUnw748

ubuntu-drivers list
sudo ubuntu-drivers autoinstall
eubnara commented 3 years ago

ideapad 5 pro 16 wireless driver 설치

RTL8852 로 보인다. (아마도 RTL8852ae ?)

❯ lspci | less | grep Network
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8852

참고: https://help.ubuntu.com/stable/ubuntu-help/net-wireless-troubleshooting-hardware-check.html.en

https://github.com/lwfinger/rtw89

빌드가 5.11 버전에서 가능했다. (kde neon 20.04) 5.11.0-37-generic

ubuntu-mainline-kernel.sh 로 최신 커널을 설치해서는 빌드가 잘 안됐다.

++++ 5.11.0-38-generic 로 어느시점부터 변경되었는데, 이후로 wireless driver 가 다시 잡히지 않았다.

cd rtw89
make clean # 이걸 안하고 make 하니 이전 빌드 내용이 남아있어서 그런지 modprobe: ERROR: could not insert 'rtw89pci': Exec format error 가 발생했다.
make
sudo make install
sudo modprobe rtw89pci
eubnara commented 2 years ago

plasma customization saver

https://www.youtube.com/watch?v=BlkaltmM5y4

eubnara commented 2 years ago

kdewallet 에 ssh 비밀번호 저장해두고, 쿼리하여 interactive 하게 입력할 필요없이 ssh 접속하기

예제)

sshpass -p `kwallet-query -r folder_entry wallet_name -f folder_name` ssh -o StrictHostKeyChecking=no  username@10.1.1.1

참고:

eubnara commented 2 years ago

외부 모니터 밝기조절 앱

https://github.com/ddccontrol/ddccontrol

eubnara commented 12 months ago

AppImageLauncher

appimage 을 잘 관리하도록 해준다. https://github.com/TheAssassin/AppImageLauncher