개요

  • 리눅스 X윈도우의 컴포지터로 Compton을 사용할 때, 매우 가볍고 버그도 거의 안 보여서 매우 만족도가 높다. (Gnome 데스크탑의 경우에는 Mutter,Compiz 같은 더 무겁고 기능이 빵빵한 것들을 쓰기 때문에 논의)
  • 다만 오리지널 compton에서는 기능의 부족이 조금 아쉬울 때가 있다.
  • 예를 들어, 윈도우를 투명하게 만들어주는 효과를 줄 수는 있지만, 이때 Blur 효과를 주는 기능이 빠져있는 것이다.
  • 최근의 동향을 보니, 오리지널 Compton에서 이 기능을 추가하려는 것은 아직 논의단계인 것 같다. 따라서 오리지널에서 포크하여 Blur 기능을 추가한 판본을 구해서, 빌드하여 적용하는 것이 현재로서는 최선으로 파악된다.
  • 여기서는 tryone144라는 개발자가 손을 본 판본을 사용해 본다. 이 판본의 단점은, 2018년 이후로 업데이트가 안되고 있다는 점, 그리고 그래픽카드 특성을 좀 타는 것 같다는 것이다.

빌드 전에 의존성 충족

sudo apt install libxcomposite-dev libxcb-composite0-dev libxdamage-dev libxrandr-dev libxinerama-dev libconfig-dev libdbus-1-dev libgl1-mesa-dev asciidoc
  • 우분투 18.04 기준으로 대충 이정도면 이상없이 컴파일 되는 것 같다.

클론,메이크,인스톨

cd $HOME/git
git clone https://github.com/tryone144/compton.git
cd compton
make
make docs
sudo make install

설정파일

  • 실행할 때 compton 뒤에 옵션을 줄줄 다는 것 보다는, 설정파일을 따로 만들어서 알아보기 쉽게 관리하는 편이 나은 것 같다.
  • 설정파일을 명시적으로 밝히고 실행하려면 다음 명령을 쓴다. 사용중인 윈도우매니저에서 autostart로 이 명령을 넣어주면 될 것이다.
compton --config $HOME/.config/compton.conf -b
  • 여기서는 다음 경로에 설정파일을 만든다 : ~/.config/compton.conf
# Shadow
shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 10;
shadow-offset-x = -10;
shadow-offset-y = -10;
shadow-opacity = 0.9;
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
shadow-exclude = [
	"name = 'Notification'",
	"class_g = 'Conky'",
	"class_g ?= 'Notify-osd'",
	"class_g = 'Cairo-clock'",
	"_GTK_FRAME_EXTENTS@:c"
];
# shadow-exclude = "n:e:Notification";
# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

# Opacity
menu-opacity = 0.8;
inactive-opacity = 0.8;
# active-opacity = 0.8;
frame-opacity = 0.7;
inactive-opacity-override = false;
alpha-step = 0.06;
# inactive-dim = 0.2;
# inactive-dim-fixed = true;

# blur
blur-method = "kawase";
blur-strength = 30;
#blur-kern = "3x3box";
#blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";

blur-kern = "15,15,0.140858,0.182684,0.227638,0.272532,0.313486,0.346456,0.367879,0.375311,0.367879,0.346456,0.313486,0.272532,0.227638,0.182684,0.140858,0.182684,0.236928,0.295230,0.353455,0.406570,0.449329,0.477114,0.486752,0.477114,0.449329,0.406570,0.353455,0.295230,0.236928,0.182684,0.227638,0.295230,0.367879,0.440432,0.506617,0.559898,0.594521,0.606531,0.594521,0.559898,0.506617,0.440432,0.367879,0.295230,0.227638,0.272532,0.353455,0.440432,0.527292,0.606531,0.670320,0.711770,0.726149,0.711770,0.670320,0.606531,0.527292,0.440432,0.353455,0.272532,0.313486,0.406570,0.506617,0.606531,0.697676,0.771052,0.818731,0.835270,0.818731,0.771052,0.697676,0.606531,0.506617,0.406570,0.313486,0.346456,0.449329,0.559898,0.670320,0.771052,0.852144,0.904837,0.923116,0.904837,0.852144,0.771052,0.670320,0.559898,0.449329,0.346456,0.367879,0.477114,0.594521,0.711770,0.818731,0.904837,0.960789,0.980199,0.960789,0.904837,0.818731,0.711770,0.594521,0.477114,0.367879,0.375311,0.486752,0.606531,0.726149,0.835270,0.923116,0.980199,0.980199,0.923116,0.835270,0.726149,0.606531,0.486752,0.375311,0.367879,0.477114,0.594521,0.711770,0.818731,0.904837,0.960789,0.980199,0.960789,0.904837,0.818731,0.711770,0.594521,0.477114,0.367879,0.346456,0.449329,0.559898,0.670320,0.771052,0.852144,0.904837,0.923116,0.904837,0.852144,0.771052,0.670320,0.559898,0.449329,0.346456,0.313486,0.406570,0.506617,0.606531,0.697676,0.771052,0.818731,0.835270,0.818731,0.771052,0.697676,0.606531,0.506617,0.406570,0.313486,0.272532,0.353455,0.440432,0.527292,0.606531,0.670320,0.711770,0.726149,0.711770,0.670320,0.606531,0.527292,0.440432,0.353455,0.272532,0.227638,0.295230,0.367879,0.440432,0.506617,0.559898,0.594521,0.606531,0.594521,0.559898,0.506617,0.440432,0.367879,0.295230,0.227638,0.182684,0.236928,0.295230,0.353455,0.406570,0.449329,0.477114,0.486752,0.477114,0.449329,0.406570,0.353455,0.295230,0.236928,0.182684,0.140858,0.182684,0.227638,0.272532,0.313486,0.346456,0.367879,0.375311,0.367879,0.346456,0.313486,0.272532,0.227638,0.182684,0.140858";


blur-background = true;
blur-background-frame = true;
blur-background-fixed = true;
#blur-background-exclude = [
#	"window_type = 'dock'",
#	"window_type = 'desktop'",
#	"_GTK_FRAME_EXTENTS@:c"
#];

# Fading
fading = true;
# fade-delta = 30;
fade-in-step = 200;
fade-out-step = 200;
# no-fading-openclose = true;
# no-fading-destroyed-argb = true;
fade-exclude = [ ];

# Other
#backend = "xrender";
backend = "glx";
mark-wmwin-focused = true;
mark-ovredir-focused = true;
# use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
#vsync = "none";
vsync = "opengl";
dbe = false;
paint-on-overlay = true;
# sw-opti = true;
# unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
# unredir-if-possible-exclude = [ ];
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# resize-damage = 1;

# GLX backend
glx-no-stencil = true;
glx-copy-from-front = false;
# glx-use-copysubbuffermesa = true;
# glx-no-rebind-pixmap = true;
glx-swap-method = "undefined";
glx-use-gpushader4 = true;
# xrender-sync = true;
# xrender-sync-fence = true;

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; };
};

opacity-rule = [
      "70:class_g = 'URxvt'",
      "70:class_g = 'Terminator'",
      "90:class_g = 'Atom'",
      "90:class_g = 'Code'",
      "90:class_g = 'Pluma'",
      "90:class_g = 'Pcmanfm'",
      "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

설정파일 설명

  • tryone144 판본에서는, 그림자 효과가 좀 더 개선된 것 같다. 특히 다음 옵션을 주면 그림자의 색상도 조절 가능하다고 한다.
shadow-red = 0.0;
shadow-green = 0.0;
shadow-blue = 0.0;
  • Blur 효과를 줄 때는 반드시 다음 설정을 먹여주는 것이 좋다고 한다.
backend = "glx";
vsync = "opengl";
glx-no-stencil = true;
glx-swap-method = "undefined";
  • Blur 효과를 활성화하려면 반드시 다음 설정도 들어가야 한다. kawase는 blur 효과를 주기 위한 알고리즘의 이름이다. blur-strength는 1~20 사이의 값을 주면 된다고 되어 있다.
blur-method = "kawase";
blur-strength = 15;
blur-background = true;
  • 마지막으로 blur-kern 항목인데(블러 커널의 줄임말 같다), 이것은 필수적으로 들어가야 하는데, 그래픽카드 특성을 크게 타는 부분 같다.
  • 개인적으로 실험해 보니, 인텔 내장그래픽을 사용한 노트북에서는 blur-kern = "3x3box";으로 설정해 주니깐 작동이 잘 된다.
  • Quadro p400 그래픽카드를 사용한 데스크탑에서는 온갖 짓을 해도 안 되길래, 웹서핑을 해서 온갖 값을 찾아 헤메다가 다음 값을 넣어주니깐 작동이 된다.
blur-kern = "15,15,0.140858,0.182684,0.227638,0.272532,0.313486,0.346456,0.367879,0.375311,0.367879,0.346456,0.313486,0.272532,0.227638,0.182684,0.140858,0.182684,0.236928,0.295230,0.353455,0.406570,0.449329,0.477114,0.486752,0.477114,0.449329,0.406570,0.353455,0.295230,0.236928,0.182684,0.227638,0.295230,0.367879,0.440432,0.506617,0.559898,0.594521,0.606531,0.594521,0.559898,0.506617,0.440432,0.367879,0.295230,0.227638,0.272532,0.353455,0.440432,0.527292,0.606531,0.670320,0.711770,0.726149,0.711770,0.670320,0.606531,0.527292,0.440432,0.353455,0.272532,0.313486,0.406570,0.506617,0.606531,0.697676,0.771052,0.818731,0.835270,0.818731,0.771052,0.697676,0.606531,0.506617,0.406570,0.313486,0.346456,0.449329,0.559898,0.670320,0.771052,0.852144,0.904837,0.923116,0.904837,0.852144,0.771052,0.670320,0.559898,0.449329,0.346456,0.367879,0.477114,0.594521,0.711770,0.818731,0.904837,0.960789,0.980199,0.960789,0.904837,0.818731,0.711770,0.594521,0.477114,0.367879,0.375311,0.486752,0.606531,0.726149,0.835270,0.923116,0.980199,0.980199,0.923116,0.835270,0.726149,0.606531,0.486752,0.375311,0.367879,0.477114,0.594521,0.711770,0.818731,0.904837,0.960789,0.980199,0.960789,0.904837,0.818731,0.711770,0.594521,0.477114,0.367879,0.346456,0.449329,0.559898,0.670320,0.771052,0.852144,0.904837,0.923116,0.904837,0.852144,0.771052,0.670320,0.559898,0.449329,0.346456,0.313486,0.406570,0.506617,0.606531,0.697676,0.771052,0.818731,0.835270,0.818731,0.771052,0.697676,0.606531,0.506617,0.406570,0.313486,0.272532,0.353455,0.440432,0.527292,0.606531,0.670320,0.711770,0.726149,0.711770,0.670320,0.606531,0.527292,0.440432,0.353455,0.272532,0.227638,0.295230,0.367879,0.440432,0.506617,0.559898,0.594521,0.606531,0.594521,0.559898,0.506617,0.440432,0.367879,0.295230,0.227638,0.182684,0.236928,0.295230,0.353455,0.406570,0.449329,0.477114,0.486752,0.477114,0.449329,0.406570,0.353455,0.295230,0.236928,0.182684,0.140858,0.182684,0.227638,0.272532,0.313486,0.346456,0.367879,0.375311,0.367879,0.346456,0.313486,0.272532,0.227638,0.182684,0.140858";
  • 어떤 사람은 다음 값이 먹혀들어간다고 한다.
blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
  • 어떤 값이 작동이 되는지는 각자의 그래픽카드에 따라 달린 것 같다. 또 나타나는 양상도 좀 다른 것 같다.

  • 기타 다른 설정들은 매뉴얼 보면서 대충 통빡(?)으로 맞춰보면 된다.

트러블슈트

  • 노트북에서 빌드한 compton을 실행 해 보니, libpcre.so.1 파일이 없다고 에러가 나온다. 비슷한 파일을 찾아보니 libpcre.so.3 파일이 존재하길래, 심볼릭 링크로 같은 디렉토리 안에 libpcre.so.1을 만들어 주니 이상없이 작동 된다.

적용 결과

  • 인텔 내장그래픽 노트북의 경우

2019-06-24-110950_1366x768_scrot

2019-06-24-221141_1366x768_scrot

2019-06-24-235711_1366x768_scrot

  • Quadro p400 그래픽카드 데스크탑의 경우 (NVIDIA 430 드라이버 적용)

2019-06-23-215624_1920x1080_scrot

2019-06-23-215638_1920x1080_scrot

활성창만 불투명으로 보이도록 설정.

  • HiDPI (Test)

2019-06-24-163121_3840x2160_scrot

고해상도 상황에서는 아무래도 퍼포먼스가 많이 저하된다…

잠정 결론

  • 아마 그래픽카드에 따라서 특성을 좀 타는 것 같고, NIDIA의 경우에는 제대로 동작하지 않아서 blur-kern 설정을 건드려서 억지로 맞추는 수 밖에 없었다. 확실하게 정상 동작하는 것은 인텔 드라이버 같다.

끝!