레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시

2018년 10월 10일 수요일

리눅스 키보드 xkbcomp 설정

1. Right Alt, Right Ctrl 에 대한 한/영, 한자 키 매핑에 대한 심볼 선언

※ Ubuntu 에서는 /usr/share/X11/xkb/symbols/kr 에 이미 정의되어 있음

partial function_keys
xkb_symbols "ralt_hangul" {
    replace key <RALT> {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1]= [ Hangul ]
    };
};

partial function_keys
xkb_symbols "rctrl_hangul" {
    replace key <RCTL> {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1]= [ Hangul ]
    };
};

partial function_keys
xkb_symbols "ralt_hanja" {
    replace key <RALT> {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1]= [ Hangul_Hanja ]
    };
};

partial function_keys
xkb_symbols "rctrl_hanja" {
    replace key <RCTL> {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1]= [ Hangul_Hanja ]
    };

};


2. 키 매핑 설정

※ 여기서는 /usr/local/etc/.xkbcompusr.xkb 파일에 저장

xkb_keymap {
xkb_keycodes  { include "evdev+aliases(qwerty)" };
xkb_types     { include "complete" };
xkb_compat    { include "complete" };
xkb_symbols   { include "pc+us+inet(evdev)+terminate(ctrl_alt_bksp)+kr(ralt_hangul)+kr(rctrl_hanja)" };
xkb_geometry  { include "pc(pc105)" };

};


3. 시작시 매번 로딩

xkbcomp /usr/local/etc/.xkbcompusr.xkb $DISPLAY

Fontconfig

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <!-- workaround for wrong style and weight -->
  <match target="pattern">
    <test qual="any" name="family">
      <string>Ubuntu Mono</string>
    </test>
    <edit mode="append" binding="strong" name="family" >
      <string>D2Coding</string>
    </edit>
  </match>
  <match target="font">
    <test name="family">
      <string>NanumGothic</string>
    </test>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
    <edit name="hintstyle" mode="assign">
      <const>hintfull</const>
    </edit>
  </match>
  <match target="font">
    <test name="family">
      <string>DejaVu Sans Mono</string>
    </test>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
    <edit name="hintstyle" mode="assign">
      <const>hintslight</const>
    </edit>
  </match>
  <match target="font">
    <test name="family">
      <string>Consolas</string>
    </test>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
    <edit name="hintstyle" mode="assign">
      <const>hintslight</const>
      <!--const>hintfull</const-->
    </edit>
    <edit name="pixelsize" mode="assign">
      <plus><name>pixelsize</name>, <double>2.0</double></plus>
    </edit>
  </match>
  <match target="font">
    <test name="family">
      <string>Ubuntu Mono</string>
    </test>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
    <edit name="hintstyle" mode="assign">
      <const>hintfull</const>
    </edit>
    <edit name="pixelsize" mode="assign">
      <plus><name>pixelsize</name>, <double>2.0</double></plus>
    </edit>
  </match>
</fontconfig>

2017년 6월 20일 화요일

2016년 3월 29일 화요일

2016년 2월 12일 금요일

한글 입력기 fcitx 설정

1. 설치

add-apt-repository ppa:createsc/3beol
apt-get update
apt-get install fcitx fcitx-mozc fcitx-hangul fcitx-libs-qt5 fcitx-frontend-qt5
                        fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-config-gtk fcitx-ui-classic


2. 키보드 입력기 설정 변경

im-config 실행하여 fcitx 로 변경

2016년 1월 19일 화요일

리눅스 키보드 xmodmap 설정

1. xev 사용하여 Key Code 알아내기

※ Key Code 는 시스템에 따라 다를 수 있다.

(1) 우측 Alt Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23413094, (666,16), root:(2590,849),
    state 0x0, keycode 108 (keysym 0xff31, Hangul), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23413166, (666,16), root:(2590,849),
    state 0x8, keycode 108 (keysym 0xff31, Hangul), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(2) 우측 Ctrl Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23414782, (666,16), root:(2590,849),
    state 0x0, keycode 105 (keysym 0xff34, Hangul_Hanja), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23414870, (666,16), root:(2590,849),
    state 0x4, keycode 105 (keysym 0xff34, Hangul_Hanja), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(3) CapsLock Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23418342, (666,16), root:(2590,849),
    state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23418438, (666,16), root:(2590,849),
    state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


(4) Window Key

KeyPress event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23422646, (666,16), root:(2590,849),
    state 0x0, keycode 133 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6400001,
    root 0xe7, subw 0x0, time 23422734, (666,16), root:(2590,849),
    state 0x40, keycode 133 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


2. 우측 Alt Key 를 한글 Key 로 설정

xmodmap -e "remove mod1 = Alt_R"
xmodmap -e "keycode 108 = Hangul"


3. 우측 Ctrl Key 를 한자 Key로 설정

xmodmap -e "remove control = Control_R"
xmodmap -e "keycode 105 = Hangul_Hanja"


4. CapsLock Key 를 Ctrl Key 로 설정

xmodmap -e "keycode 66 = Control_L"
xmodmap -e "clear Lock"
xmodmap -e "add Control = Control_L"


5. Window Key 를 Menu Key 로 설정

xmodmap -e "keycode 133 = Menu"


6. 설정 (Key Mapping) 영구 저장

xmodmap -pke > ~/.Xmodmap


7. 부팅시 실행: 다음을 자동으로 시작되도록 지정

xmodmap ~/.Xmodmap

2016년 1월 15일 금요일

JAVA 8 설치 (JDK 8u66)

1. 설치

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer


2. 설치된 JAVA 버전 확인

java -version

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)


3. JAVA 환경 설정 패키지

sudo apt-get install oracle-java8-set-default

2016년 1월 6일 수요일

2015년 6월 4일 목요일

2015년 5월 27일 수요일

FLAC 변환 - flac

flac - Free Lossless Audio Codec

Usage: 
flac [OPTIONS] [infile.wav | infile.aiff | infile.raw | infile.flac | infile.ogg] ...

flac [-d | --decode | -t | --test | -a | --analyze] [OPTIONS] [infile.flac | infile.ogg] ...


1. 옵션

-f, --force
        Force overwriting of output files

-V, --verify
        Verify (원본과 비교)

--force-raw-format
        input (when encoding)  is raw (확장자 무시)
        output (when decoding) is raw (확장자 무시)

--endian={big|little}
        endian (byte order)

--channels=#
        number of channels.

--sample-rate=#
        sample rate (in Hz)

--sign={signed|unsigned}
        Set the sign (default: signed)

--bps=#
        Set bits

-0 ~ -8, --compression-level-0 ~ --compression-level-8
        Fastest compression ~ highest compression (default is -5)

-T TITLE=title
        audio/song title

-T ARTIST=artist
        audio/song artist

-T ALBUM=album
        audio/song album

-T DATE=year
        audio/song year

-T TRACKNUMBER=trackno
        audio/song trackno

-T GENRE=genre
        audio/song genre

-o filename, --output-name=filename
        output file name

-d, --decode
        Decode

-t, --test
        Test flac file

-a, --analyze
        Analyze flac file


2. 예제

(1) encoding
flac -f -V --force-raw-format --endian=little --channels=2 --sample-rate=44100 --sign=signed --bps=16 -8 -T TITLE=title -T ARTIST=artist -T ALBUM=album -T DATE=year -T TRACKNUMBER=trackno -T GENRE=genre file -o trackno - tfile.flac

(2) decoding
flac -d -f --force-raw-format --endian=little --sign=signed filename.flac -o file


3. 스크립트

flac.exe - encoding
flacd.exe - decoding

MP3 인코딩 - lame

lame - create mp3 audio files

Usage: lame [options] <infile> <outfile>


1. 옵션

-r
        raw file

--bitwidth n
        Input bit width per sample
        n = 8, 16, 24, 32 (default 16)

--little-endian
        little-endian (only for raw)

--noreplaygain
        Disable ReplayGain analysis

-s sfreq
        sfreq = 8/11.025/12/16/22.05/24/32/44.1/48  (only for raw)

-q qual
        0 <= qual <= 9

        -q 0: slowest & best
        -q 2: recommended (-h)
        -q 5: default
        -q 7: Very fast (-f)
        -q 9: Poor quality

-b n
        CBR bitrate
        n = 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

--cbr
        Use CBR

--id3v2-only
        only version 2 tag

--id3v2-utf16
        unicode text encoding

--tt title
        audio/song title

--ta artist
        audio/song artist

--tl album
        audio/song album

--ty year
        audio/song year

--tn track[/total]
        audio/song track and total number

--tg genre
        audio/song genre


2. 예제

lame -r --bitwidth 16 --little-endian --noreplaygain -s 44.1 -q 0 -b 320 --cbr --id3v2-only --id3v2-utf16 --tt title --ta artist --tl album --ty year --tn trackno --tg genre file.raw trackno - tfile.mp3


3. 스크립트

2014년 7월 4일 금요일