RHEL7.x(Centos7.x) 기반 데스크탑 환경 구축 하기

본 영상은 2560×1440 해상도의 모니터가 Dual로 구성된 환경으로 전체 데스크탑 화면을 모두 캡쳐한거라

전체적으로 영상이 축소되어 보입니다. 전체 화면으로 보시는 것을 권장합니다.

 

RHEL7.x 기반 데스크탑 환경 구축 하기

작성일 : 2015년 12월 8일
작성자 : 서진우 (시스존)

1. RHEL7.x 설치

소프트웨어 구성에서 서버GUI 모드로 설치함.

2. NVIDIA Graphic Driver 설치

# vi /boot/grub2/grub.cfg
menuentry ‘Red Hat Enterprise Linux Server 7.1 (Maipo) …{

.
linux16 /boot/vmlinuz-3.10.0-229.el7.x86_64 root=UUID=0df416bd-ae66-4cc6-b1fa-2b4c2dd7c342 ro crashkernel=auto rhgb quiet LANG=ko_KR.UTF-8 rdblacklist=nouveau

;; 커널 옵션 마지막에 rdblacklist=nouveau 추가

# vi /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
blacklist nouveau
options nouveau modeset=1

기본 부팅 runlevel 을 3 로 변경

# systemctl set-default multi-user.target

리부팅 후 NVIDIA Drive 설치

# sh NVIDIA-Linux-x86_64-358.16.run

runlevel 5 로 변경

# systemctl set-default graphical.target

3. 폰트 설치 및 글꼴 변경

적용할 폰트를 아래 위치에 복사한다.

$ mkdir .local/share/fonts
$ cp <font ttf file> .local/share/fonts

폰트 변경

Gnome Menu 에서 프로그램>유틸리티>Tweak Tool>글꼴

4. 주요 yum repo 설정

# rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

# vi /etc/yum.repos.d/centos.repo
————————————————————————–
[base-be]
name=CentOS-7 – Base
repo=os
baseurl=http://ftp.daum.net/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://ftp.daum.net/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[updates-be]
name=CentOS-7 – Updates
baseurl=http://ftp.daum.net/centos/7/updates/x86_64/
enable=1
gpgcheck=1

[centosplus-be]
name=CentOS-7 – Plus
baseurl=http://ftp.daum.net/centos/7/centosplus/x86_64/
enabled=1
gpgcheck=1

[extras-be]
name=CentOS-7 – Extras
baseurl=http://ftp.daum.net/centos/7/extras/x86_64/
enable=1
gpgcheck=1

[fasttrack-be]
name=CentOS-7 – Fasttrack
baseurl=http://ftp.daum.net/centos/7/fasttrack/x86_64/
enabled=1
gpgcheck=1
————————————————————————-

# rpm –import http://ftp.daum.net/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

# yum repolist
# yum install hdparm

# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
# yum repolist

# yum –enablerepo=nux-dextop install <package-name>

5. Mate Desktop 설치하기 및 설정하기

RHEL7 에서는 gnome-shell을 이요할 수 있는 gnome3  혹은 gnome classic이 기본
환경으로 제공된다.

gnome2 기반의 UI에 익숙한 사용자의 경우 mate desktop을 설치하면 거의 동일한
UI 환경으로 사용이 가능하다.

또한 이전에 compiz 와 같은 3D desktop 효과를 이용한 사용자라면 xfce 혹은
mate desktop 으로 데스크탑 환경을 변경해야 한다. gnome3 는 자체적으로 3D 관련
효과가 기본적으로 제공되기 때문에 compiz 를 실행하면 충돌이 발생하게 된다.

개인적으로 compiz-fusion 환경을 선호하는 관계로 mate desktop 을 설치하도록
한다.

# yum groupinstall “MATE Desktop”

현재 접속된 gnome 세션에서 로그오프 하고 다시 GDM 로그인 창의 설정아이콘을 클릭하면
하단에 표시된 “그놈” 을 선택한다.

이제 RHEL5~6 환경에서의 gnome desktop 과 유사한 UI 가 나타난다.

– 한영전환 방식 : ibus-setup 실행, 일반탭>다음입력 방식 : <Shift>space 로 변경

– 폰트변경 : gnome 메뉴>기본설정>시스템>모양새>모양>글꼴
;; 나눔고딕 10, 맑은고디 10 추천

– GTK Themes 설치 : Mac4Lin, Paper 추천

$ wget http://jaist.dl.sourceforge.net/project/mac4lin/mac4lin/ver.1.0/Mac4Lin_Install_v1.0.zip
$ mkdir Mac4Lin
$ mv Mac4Lin_Install_v1.0.zip Mac4Lin
$ cd Mac4Lin
$ unzip Mac4Lin_Install_v1.0.zip
$ cd Mac4Lin_Install_v1.0/
$ sudo ./Mac4Lin_Install_v1.0.sh

# rpm -ivh paper-gtk-theme-3.9.2-1.20150205giteefb7ea.fc20.noarch.rpm
# paper-icon-theme-3.9.2-1.20150205gitaca8802.fc20.noarch.rpm

$ wget http://faenza-icon-theme.googlecode.com/files/faenza-icon-theme_1.3.zip
$ mkdir faeza ; mv faenza-icon-theme_1.3.zip faeza; cd faeza
$ unzip faenza-icon-theme_1.3.zip
$ sh INSTALL

– 창 설정 : gnome 메뉴>기본설정>시스템>모양새>모양>창
일반 : 소프트웨어 합성 효과 창 관리자 활성화
동작 :
창 위에 마우스가 지나가면 그창 선택 체크
창을 띄우기 전에 지연 0.5
제목표시줄 두번 눌렀을때 말아올리기

– 키보드 바로 가기 : gnome 메뉴>기본설정>시스템>하드웨어>키보드바로가기
터미널 실행 > Ctrl + Enter
창최대화 토글 > Ctrl + Up
창세로로 최대 > Ctrl + Alt + Down
현재 작업공간의 왼쪽 작업공간으로 이동 > Ctrl + Left
현재 작업공간의 오른쪽 작업공간으로 이동 > Ctrl + Right
좌측작업공간으로 창이동 > Ctrl + Alt + Left
우측작업공간으로 창이동 > Ctrl + Alt + Right

6. Compiz 설치하기 및 설정하기

compiz 관련 패키지는 yum repo 구성 시 nux 사이트에서 제공하게 된다.

# yum install compiz compiz-manager compiz-mate compizconfig-python libcompizconfig emerald-themes* ccsm compiz-plugin-main* compiz-plugins-extra* compiz-manager fusion-icon fusion-icon-gtk emerald emerald-devel

# yum install Pyrex

만일 Nux 사이트가 더이상 접속이 불가한 경우엔 Fedora 19, 20 버전에서 제공하는
compiz 관련 Source RPM 를 rebuild 하여 적용이 가능하다.

compiz-fusion 의 세부적인 설정은 RHEL6_install 문서를 참고하길 바람.

– compiz-fusion 접근성 설정하기

ctrl + left : 큐브 왼쪽 작업 공간
ctrl + Right : 큐브 오른쪽 작업공간
ctrl + alt + left : 해당 창은 외쪽 작업공간  으로 이동
ctrl + alt + right : 해당 창을 오른쪽 작업 공간으로 이동
ctrl + 마우스 휠 : 화면 확대
ctrl + 마우스 오른쪽 버턴으로 공간 선택 : 선택 화면 학대
ctrl + alt + 마우스 왼쪽 : 마우스로 큐브 창돌리기
마우스 휠 버턴 : 마우스로 큐브 창돌리기
super + 왼쪽 마우스로  공간 선택 : 선택 화면 캡처
shift + ctrl + 마우스 왼쪽키로 선 그리기 : 불꽃 선 그리기
shift + ctrl + c : 불꽃선 지우기
super + tab : 현재 작업 창에 오픈된 창 switch
alt + super + tab : 전체 작업창에 오픈된 창 switch
마우스 왼쪽 상단 모서리 : 작업공간 expo
super + e : 작업 공간 expo
마우스 오른쪽 상단 모서리 : 현재 작업 공간에 오픈된 창 정렬
ctrl + tab : APP swtich
alt + ctrl + tab : 모든 작업 공간의 app switch
ctrl + bottom : 작업공간 switch
ctrl + alt + bottom : 해당창 세로로 최대화
shift + super + 마우스 왼쪽 : 데스크탑 화면을 복제 해서 다른 데스크탑 영역에 옮겨 놓을 수 있다.
듀얼모니터일 경우 모니터 구성을 clone으로 하지 않더라도 복제된 모니터 화면 구성을 만들수 있다.

접근가능정도 >  Enhanced Zoom Desktop

기본 zoom 기능의 경우 화면만 확대되고, 확대된 화면을 제어할수 없다.
하지만 enhanced zoom 은 확대된 화면을 제어할 수가 있다.

super + 1 : 표준화면 (초기화)
super + 2 : 50% 확대
super + 3 : 100% 확대
super + c : mouse 포인터 가운데 정렬
super + v : 화면크기에 맞게 창크기 확대
super + f : 화면을 확대된 상태에서 고정
super + r : 창크기에 화면 확대
super + 휠업  : 화면 확대
super + 휠다운 : 화면 축소
super + up : 화면 확대
super + down : 화면 축소

특정 창에 맞게 화면 확대 하기 -> super + r + v + r + f

7. 주요 응용 S/W 설치

# yum install xulrunner

– google chrome browser

# wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

google chrome 을 설치하고 인터넷에 접속하면 google 이나 naver 등의 검색 input box 에
한글글자가 거칠게 나올 수 있다.

이때는 google chrome 의 확장 프로그램 중 webfont css 관련 확장 프로그램을 설치하여
해결이 가능하다.

크롬 웹스토어에서 확장프로그램 Font Changer with google web font를 설치합니다.
(크롬 브라우저에서 https://chrome.google.com/webstore/category/extensions?hl=ko

주소창 우측상단에 FC라는 로고 아이콘이 생성됩니다.
클릭하여 Font name 아래의 Edit Custom Font를 클릭
나눔고딕 폰트 추가..

이 방법을 사용할 경우 간혹 기호 문자가 깨지는 경우가 있음.

이런 경우는 확장프로그램으로 Font Chager 대신 stylebot을 설치하고,
Stylebot Option>Styles>Global Sttylesheet>”Edit Global Stylesheet” 버튼 선택

input {
font-family: Nanum Gothic;
text-shadow: #fff 0px 1px 1px;
text-stroke: 1px rgba(0,0,0,0.1);
font-size: 15px;
}

body, td, textarea, select, div, p, span, code,font {
font-family: Nanum Gothic;
text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
text-stroke: 0.6px;
font-size: 12px;
}

입력하여 해결 가능하다.

# yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

# yum install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm

# yum install flash-plugin

# yum install transmission

# yum install vlc smplayer ffmpeg HandBrake-{gui,cli}

# yum install libdvdcss gstreamer{,1}-plugins-ugly gstreamer-plugins-bad-nonfree gstreamer1-plugins-bad-freeworld

# yum install ffmpeg

# yum install plank

# rpm -ivh plank-theme-moka-1.0-2.noarch.rpm

# yum install hancomofficehwpviewer-9.20.0.570-1.x86_64.rpm

# yum install simplescreenrecorder

# wget https://updates.tdesktop.com/tlinux/tsetup.0.7.23.tar.xz

# yum install gstreamer*

# yum install mplayer*

skin을 받아서 /usr/share/mplayer/skins 에 복사
그런 후 원하는 skin 디렉토리를 default 명으로 link

# yum install glibc alsa-lib freetype libICE libSM libX11 libXau libXdamage libXext libXfixes libXi libXrandr libXrender libXtst libgcc libuuid libxcb zlib

# yum install teamviewer.i686.rpm
# yum install lua-devel openssl-devel libconfig-devel readline-devel libevent-devel

# yum install youtube-dl

# wget https://updates.tdesktop.com/tlinux/tsetup.0.9.13.tar.xz
# xz tsetup.0.9.13.tar.xz
# tar xvf tsetup.0.9.13.tar
# mv Telegram/* /usr/local/bin

# mkdir haroopad
# wget https://bitbucket.org/rhiokim/haroopad-download/downloads/haroopad-v0.13.1-x64.tar.gz
# tar xzvf haroopad-v0.13.1-x64.tar.gz
# tar xvzf data.tar.gz
# cp -a usr/ /
# tar xzvf control.tar.gz
# chmod 755 postinst
# ./postinst
# vi /usr/share/applications/Haroopad.desktop

# yum install wps-office-9.1.0.4975-1.a19p1.x86_64.rpm

# yum install python-mutagen
# yum install tigervnc

# yum install tilda-0.9.6-11.el7.x86_64.rpm

8. 환경 설정

– conky 설정하기

# yum install conky

$ vi .conkyrc

#==============================================================================
#                               conkyrc_seamod
# Date    : 05/02/2012
# Author  : SeaJey
# Version : v0.1
# License : Distributed under the terms of GNU GPL version 2 or later
#
# This version is a modification of conkyrc_lunatico wich is modification of conkyrc_orange
#
# conkyrc_orange:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
# conkyrc_lunatico:  http://gnome-look.org/content/show.php?content=142884
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 1
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048
override_utf8_locale yes
use_xft yes
xftfont caviar dreams:size=10
xftalpha 0.8
uppercase no

gap_x 0
gap_y 0
minimum_size 290 1420
maximum_width 290

own_window yes
own_window_type normal
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 100
own_window_colour 000000
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0
alignment top_right

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Defining colors
default_color FFFFFF
# Shades of Gray
color1 DDDDDD
color2 AAAAAA
color3 888888
# Orange
color4 EF5A29
# Green
color5 77B753

# Loading lua script for drawning rings
lua_load ./seamod_rings.lua
lua_draw_hook_post main

## System information using conky capabilities

TEXT
${voffset 5}${offset 92}${font openlogos:size=25}${color red}o${voffset -9}${font Arial:bold:size=17}${color Tan1}  RedHat ES 7.1
${offset 96}${font Arial:bold:size=14}${color Ivory}Hostname :  $nodename
${voffset 3}${offset 102}${font Poky:size=13}d${font Arial:bold:size=13}${voffset -1} ${color slate gray}${time %F} ${time %H:%M:%S}
# Showing CPU Graph
${voffset 0}
${offset 120}${cpugraph 40,183 666666 666666}${voffset -25}
${offset 90}${font Fixed:size=10,weight:bold}${color5}CPU
# Showing TOP 5 CPU-consumers
${offset 105}${font Fixed:size=10,weight:normal}${color4}${top name 1}${alignr}${top cpu 1}%
${offset 105}${font Fixed:size=10,weight:normal}${color1}${top name 2}${alignr}${top cpu 2}%
${offset 105}${font Fixed:size=10,weight:normal}${color2}${top name 3}${alignr}${top cpu 3}%
${offset 105}${font Fixed:size=10,weight:normal}${color3}${top name 4}${alignr}${top cpu 4}%
${offset 105}${font Fixed:size=10,weight:normal}${color3}${top name 5}${alignr}${top cpu 5}%

#Showing memory part with TOP 5
${voffset 60}
${offset 90}${font Fixed:size=10,weight:bold}${color5}MEM
${offset 105}${font Fixed:size=10,weight:normal}${color4}${top_mem name 1}${alignr}${top_mem mem 1}%
${offset 105}${font Fixed:size=10,weight:normal}${color1}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 105}${font Fixed:size=10,weight:normal}${color2}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 105}${font Fixed:size=10,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 105}${font Fixed:size=10,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 5}%

# Showing disk partitions: root, home and Data
${voffset 22}
${offset 90}${font Fixed:size=10,weight:bold}${color5}DISKS
${offset 120}${diskiograph 33,183 666666 666666}${voffset -30}
${voffset 20}
${offset 115}${font Fixed:size=9,weight:bold}${color1}Free: ${font Fixed:size=9,weight:normal}${fs_free /}${alignr}${font Fixed:size=9,weight:bold}Used: ${font Fixed:size=9,weight:normal}${fs_used /}
${offset 115}${font Fixed:size=9,weight:bold}${color1}Free: ${font Fixed:size=9,weight:normal}${fs_free /PROJECT}${alignr}${font Fixed:size=9,weight:bold}Used: ${font Fixed:size=9,weight:normal}${fs_used /PROJECT}
${offset 115}${font Fixed:size=9,weight:bold}${color1}Free: ${font Fixed:size=9,weight:normal}${fs_free /home}${alignr}${font Fixed:size=9,weight:bold}Used: ${font Fixed:size=9,weight:normal}${fs_used /home}

# Network data (my desktop have only LAN). ETHERNET ring is mostly useless but looks pretty, main info is in the graphs
${voffset 70}
${voffset 20}${offset 90}${font Fixed:size=10,weight:bold}${color5}ETHERNET
${voffset 40}

${offset 15}${color1}${font Fixed:size=9,weight:bold}${color3}>192.168.123.1
${offset 15}${color1}${font Fixed:size=9,weight:bold}Up: ${alignr}${font Fixed:size=9,weight:normal}$color2${upspeed enp2s0} / ${totalup}
${offset 15}${upspeedgraph enp2s0 40,285 4B1B0C FF5C2B 100 -l}
${offset 15}${color1}${font Fixed:size=9,weight:bold}Down: ${alignr}${font Fixed:size=9,weight:normal}$color2${downspeed enp2s0} / ${totaldown}
${offset 15}${downspeedgraph enp2s0 40,285 324D23 77B753 100 -l}
${offset 15}${color1}${font Fixed:size=9,weight:bold}${color3}>192.168.201.1
${offset 15}${color1}${font Fixed:size=9,weight:bold}Up: ${alignr}${font Fixed:size=9,weight:normal}$color2${upspeed enp4s1} / ${totalup}
${offset 15}${upspeedgraph enp4s1 40,285 4B1B0C FF5C2B 100 -l}
${offset 15}${color1}${font Fixed:size=9,weight:bold}Down: ${alignr}${font Fixed:size=9,weight:normal}$color2${downspeed enp4s1} / ${totaldown}
${offset 15}${downspeedgraph enp4s1 40,285 324D23 77B753 100 -l}

${voffset 10}${font Arial:bold:size=10}${color Tan2}CALENDAR ${color white}${hr 2}
${voffset +15}${font Fixed:size=12}${color aaaaaa}${execpi 10800 DJS=`date +%-d`; LANG=en_US cal | sed ‘1d’ | sed s/” $DJS “/” “‘${color white}${font Fixed:size=12}’$DJS’${font Fixed:size=12}${color aaaaaa}'” “/}${color}${voffset -18}
${voffset 10}${color white}${hr 2}
${image ~/background/yj.png -s 90×90 -p 199,1050}
${image ~/background/ys.png -s 230×230 -p 25,1170}
${image ~/background/alang.jpg -s 60×60 -p 5,5}
#${image ~/background/yj.png -s 40×40 -p 0,500}
#${image ~/background/ys.png -s 40×40 -p 80,0}$

$ vi seamod_rings.lua
–==============================================================================
—                            seamod_rings.lua

—  Date    : 05/02/2012
—  Author  : SeaJey
—  Version : v0.1
—  License : Distributed under the terms of GNU GPL version 2 or later

—  This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua

—  conky_orange.lua:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
—  lunatico_rings.lua:  http://gnome-look.org/content/show.php?content=142884
–==============================================================================

require ‘cairo’

——————————————————————————–
—                                                                    gauge DATA
gauge = {
{
name=’cpu’,                    arg=’cpu0′,                  max_value=100,
x=70,                          y=130,
graph_radius=54,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=64,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=”,
caption_weight=1,              caption_size=9.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
name=’cpu’,                    arg=’cpu1′,                  max_value=100,
x=70,                          y=130,
graph_radius=48,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=40,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=”,
caption_weight=1,              caption_size=9.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
name=’cpu’,                    arg=’cpu2′,                  max_value=100,
x=70,                          y=130,
graph_radius=20,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=30,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=”,
caption_weight=1,              caption_size=9.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
name=’cpu’,                    arg=’cpu3′,                  max_value=100,
x=70,                          y=130,
graph_radius=14,
graph_thickness=5,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=4,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=”,
caption_weight=1,              caption_size=9.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
name=’memperc’,                arg=”,                      max_value=100,
x=70,                          y=300,
graph_radius=54,
graph_thickness=10,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=42,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0,        graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
caption=”,
caption_weight=1,              caption_size=10.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
name=’fs_used_perc’,           arg=’/home’,                     max_value=100,
x=70,                          y=470,
graph_radius=54,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=64,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0,        graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=’Home’,
caption_weight=1,              caption_size=12.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
name=’fs_used_perc’,           arg=’/PROJECT’,                     max_value=100,
x=70,                          y=470,
graph_radius=42,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=32,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0,        graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=’Projt’,
caption_weight=1,              caption_size=12.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
name=’fs_used_perc’,           arg=’/’,                     max_value=100,
x=70,                          y=470,
graph_radius=30,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=1.0,
txt_radius=22,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=23,
graduation_thickness=0,        graduation_mark_thickness=2,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=’Root’,
caption_weight=1,              caption_size=12.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
name=’downspeedf’,           arg=’enp0s25′,                     max_value=100,
x=70,                          y=640,
graph_radius=54,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=0,
txt_radius=64,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=’Down’,
caption_weight=1,              caption_size=12.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
name=’upspeedf’,           arg=’enp0s25′,                     max_value=100,
x=70,                          y=640,
graph_radius=42,
graph_thickness=7,
graph_start_angle=180,
graph_unit_angle=2.7,          graph_unit_thickness=2.7,
graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
hand_fg_colour=0xEF5A29,       hand_fg_alpha=0,
txt_radius=30,
txt_weight=0,                  txt_size=9.0,
txt_fg_colour=0xEF5A29,        txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0,        graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption=’Up’,
caption_weight=1,              caption_size=12.0,
caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}

——————————————————————————-
—                                                                 rgb_to_r_g_b
— converts color in hexa to decimal

function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

——————————————————————————-
—                                                            angle_to_position
— convert degree to rad and rotate (0 degree is top/north)

function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) – (math.pi / 2) )
end

——————————————————————————-
—                                                              draw_gauge_ring
— displays gauges

function draw_gauge_ring(display, data, value)
local max_value = data[‘max_value’]
local x, y = data[‘x’], data[‘y’]
local graph_radius = data[‘graph_radius’]
local graph_thickness, graph_unit_thickness = data[‘graph_thickness’], data[‘graph_unit_thickness’]
local graph_start_angle = data[‘graph_start_angle’]
local graph_unit_angle = data[‘graph_unit_angle’]
local graph_bg_colour, graph_bg_alpha = data[‘graph_bg_colour’], data[‘graph_bg_alpha’]
local graph_fg_colour, graph_fg_alpha = data[‘graph_fg_colour’], data[‘graph_fg_alpha’]
local hand_fg_colour, hand_fg_alpha = data[‘hand_fg_colour’], data[‘hand_fg_alpha’]
local graph_end_angle = (max_value * graph_unit_angle) % 360

— background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)

— arc of value
local val = value % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) – graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc

— hand
start_arc = (graph_unit_angle * val) – (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)

— graduations marks
local graduation_radius = data[‘graduation_radius’]
local graduation_thickness, graduation_mark_thickness = data[‘graduation_thickness’], data[‘graduation_mark_thickness’]
local graduation_unit_angle = data[‘graduation_unit_angle’]
local graduation_fg_colour, graduation_fg_alpha = data[‘graduation_fg_colour’], data[‘graduation_fg_alpha’]
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) – (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end

— text
local txt_radius = data[‘txt_radius’]
local txt_weight, txt_size = data[‘txt_weight’], data[‘txt_size’]
local txt_fg_colour, txt_fg_alpha = data[‘txt_fg_colour’], data[‘txt_fg_alpha’]
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, “ubuntu”, CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex – (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)

— caption
local caption = data[‘caption’]
local caption_weight, caption_size = data[‘caption_weight’], data[‘caption_size’]
local caption_fg_colour, caption_fg_alpha = data[‘caption_fg_colour’], data[‘caption_fg_alpha’]
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, “ubuntu”, CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
— bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox – 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end

——————————————————————————-
—                                                               go_gauge_rings
— loads data and displays gauges

function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = ”, 0
str = string.format(‘${%s %s}’,data[‘name’], data[‘arg’])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end

for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
end

——————————————————————————-
—                                                                         MAIN
function conky_main()
if conky_window == nil then
return
end

local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local display = cairo_create(cs)

local updates = conky_parse(‘${updates}’)
update_num = tonumber(updates)

if update_num > 5 then
go_gauge_rings(display)
end

cairo_surface_destroy(cs)
cairo_destroy(display)

end

==========================================================================================

– vi 편집기 환경 설정

$ vi .vimrc

set tabstop=2
set shiftwidth=2
set expandtab
set softtabstop=2
set visualbell
set nobackup
set incsearch
syntax on
filetype on
set backspace=eol,start,indent
set history=1000
set hlsearch
set ignorecase
set showmatch
set fileencodings=utf8,euc-kr

– 메뉴바 없는 터미널 만들기

$ vi ~/bin/gt
————————————————————————
#!/bin/sh
mate-terminal –hide-menubar –geometry 100×35 &
————————————————————————

$ chmod 755 ~/bin/gt

– 터미널의 파일/디렉토리 색깔 밝게하기

#/etc/profile.d/colorls.sh

————————————————————————
# color-ls initialization
COLORS=/etc/DIR_COLORS
eval `dircolors –sh /etc/DIR_COLORS`
[ -f “$HOME/.dircolors” ] && eval `dircolors –sh $HOME/.dircolors` && COLORS=$HOME/.dircolors
[ -f “$HOME/.dir_colors” ] && eval `dircolors –sh $HOME/.dir_colors` && COLORS=$HOME/.dir_colors

if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only
if ! egrep -qi “^COLOR.*none” $COLORS &>/dev/null; then
alias ll=’ls -l –color=tty’
alias l.=’ls -d .[a-zA-Z]* –color=tty’
alias ls=’ls –color=tty’
else
alias ll=’ls -l’
alias l.=’ls -d .[a-zA-Z]*’
fi
fi
———————————————————————–

– ascii 파일의 encoding 변경하기

# yum install convmv

# vi /usr/local/bin/run_utf8
—————————————————————————-
#!/bin/sh

if [ $# -ne 1 ]
then
echo -n “ex: run_utf8 <euc-kr type file>
“;
exit;
fi

iconv -f euc-kr -t utf-8 “${1}” -o “${1}.tmp”
rm -f “${1}” && mv “${1}.tmp” “${1}”
convmv –notest -f euc-kr -t utf-8 “${1}”
—————————————————————————–

위 명령은 euckr 타입의 파일을 utf8 형식으로 전환하는 스크립트이다.

# vi /usr/local/bin/run_euckr
—————————————————————————–
#!/bin/sh

if [ $# -ne 1 ]
then
echo -n “ex: run_euckr <utf-8 type file>
“;
exit;
fi

iconv -f utf-8 -t euc-kr “${1}” -o “${1}.tmp”
rm -f “${1}” && mv “${1}.tmp” “${1}”
convmv –notest -f utf-8 -t euc-kr “${1}”
—————————————————————————-

# chmod 755 /usr/lcoal/bin/run_utf8
# chmod 755 /usr/lcoal/bin/run_euckr

– 음악파일 tag encoding 변경

# find -type f -iregex “.*/.*\.\(ogg\|mp3\|flac\)” -print0 | xargs -0 mid3iconv -e cp949
# mid3iconv -e utf-8 *.mp3

– 바탕화면 아이콘 없애기

$ gsettings list-recursively | grep computer-icons
$ gsettings list-recursively | grep computer-ico
$ gsettings list-recursively | grep home-icon
$ gsettings set org.mate.caja.desktop home-icon-visible false
$ gsettings set org.mate.caja.desktop home-icon-visible computer-icon-visible false
$ gsettings set org.mate.caja.desktop computer-icon-visible false
$ gsettings set org.mate.caja.desktop trash-icon-visible false

9. SELinux, 방화벽 off

# setenforce permissive
# /etc/selinux/config
SELINUX=disabled

# systemctl stop firewalld
# systemctl disable firewalld

10. rhel7 확장 rpm 저장소

http://www.stotinkaos.net/stotinkaOS/repo/7/x86_64/
https://archive.fedoraproject.org/pub/archive/fedora/linux/updates/

구현모습

저장

저장

저장

저장

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

3 Responses

  1. 서진우 말해보세요:

    RHEL7의 경우 gnome3 가 기본 환경 인지라, 개인적으로 익숙한 gnome2.x 유사 환경으로 맞추는 수고가 생기네요. .

  2. alang 말해보세요:

    screen recoder 는 simplescreenrecorder 이용

  3. Your article helped me a lot, is there any more related content? Thanks!

서진우 에 응답 남기기 응답 취소