From 4010759be55e770dd222d985b8053d4e7fa53803 Mon Sep 17 00:00:00 2001 From: Jisu Kim Date: Thu, 20 Aug 2020 12:09:10 +0900 Subject: [PATCH] enable hidpi --- linux-hidpi/conkyrc | 164 ++++++++++++++++ linux-hidpi/dconf/user | Bin 10963 -> 11328 bytes linux-hidpi/glava/bars.glsl | 33 ++++ linux-hidpi/glava/bars/1.frag | 114 ++++++++++++ linux-hidpi/glava/circle.glsl | 24 +++ linux-hidpi/glava/circle/1.frag | 84 +++++++++ linux-hidpi/glava/circle/2.frag | 33 ++++ linux-hidpi/glava/circle/3.frag | 1 + linux-hidpi/glava/env_KWin.glsl | 8 + linux-hidpi/glava/env_Openbox.glsl | 2 + linux-hidpi/glava/env_Xfwm4.glsl | 3 + linux-hidpi/glava/env_awesome.glsl | 1 + linux-hidpi/glava/env_default.glsl | 1 + linux-hidpi/glava/env_i3.glsl | 1 + linux-hidpi/glava/graph.glsl | 31 ++++ linux-hidpi/glava/graph/1.frag | 132 +++++++++++++ linux-hidpi/glava/graph/2.frag | 44 +++++ linux-hidpi/glava/graph/3.frag | 104 +++++++++++ linux-hidpi/glava/radial.glsl | 39 ++++ linux-hidpi/glava/radial/1.frag | 115 ++++++++++++ linux-hidpi/glava/radial/2.frag | 1 + linux-hidpi/glava/rc.glsl | 227 +++++++++++++++++++++++ linux-hidpi/glava/smooth_parameters.glsl | 78 ++++++++ linux-hidpi/glava/util/premultiply.frag | 17 ++ linux-hidpi/glava/util/smooth.glsl | 97 ++++++++++ linux-hidpi/glava/util/smooth_pass.frag | 16 ++ linux-hidpi/glava/wave.glsl | 14 ++ linux-hidpi/glava/wave/1.frag | 39 ++++ linux-hidpi/glava/wave/2.frag | 33 ++++ linux-hidpi/pam_environment | 2 +- linux-hidpi/picom/picom.conf | 9 +- mapping.ts | 6 +- 32 files changed, 1468 insertions(+), 5 deletions(-) create mode 100644 linux-hidpi/conkyrc create mode 100755 linux-hidpi/glava/bars.glsl create mode 100644 linux-hidpi/glava/bars/1.frag create mode 100755 linux-hidpi/glava/circle.glsl create mode 100644 linux-hidpi/glava/circle/1.frag create mode 100644 linux-hidpi/glava/circle/2.frag create mode 100644 linux-hidpi/glava/circle/3.frag create mode 100755 linux-hidpi/glava/env_KWin.glsl create mode 100755 linux-hidpi/glava/env_Openbox.glsl create mode 100755 linux-hidpi/glava/env_Xfwm4.glsl create mode 100755 linux-hidpi/glava/env_awesome.glsl create mode 100755 linux-hidpi/glava/env_default.glsl create mode 100755 linux-hidpi/glava/env_i3.glsl create mode 100755 linux-hidpi/glava/graph.glsl create mode 100644 linux-hidpi/glava/graph/1.frag create mode 100644 linux-hidpi/glava/graph/2.frag create mode 100644 linux-hidpi/glava/graph/3.frag create mode 100755 linux-hidpi/glava/radial.glsl create mode 100644 linux-hidpi/glava/radial/1.frag create mode 100644 linux-hidpi/glava/radial/2.frag create mode 100755 linux-hidpi/glava/rc.glsl create mode 100755 linux-hidpi/glava/smooth_parameters.glsl create mode 100644 linux-hidpi/glava/util/premultiply.frag create mode 100644 linux-hidpi/glava/util/smooth.glsl create mode 100644 linux-hidpi/glava/util/smooth_pass.frag create mode 100755 linux-hidpi/glava/wave.glsl create mode 100644 linux-hidpi/glava/wave/1.frag create mode 100644 linux-hidpi/glava/wave/2.frag diff --git a/linux-hidpi/conkyrc b/linux-hidpi/conkyrc new file mode 100644 index 0000000..d85400d --- /dev/null +++ b/linux-hidpi/conkyrc @@ -0,0 +1,164 @@ +conky.config = { + +------------------------------------- +-- Generic Settings +------------------------------------- +background=true, +update_interval=1, +double_buffer=true, +no_buffers=true, + +draw_shades=false, +draw_outline=false, +draw_borders=false, + + +------------------------------------- +-- Window Specifications +------------------------------------- +gap_x=800, +gap_y=550, + +minimum_height=250, +minimum_width=360, + +own_window=true, +own_window_type="normal", +own_window_transparent=true, +own_window_hints="undecorated,below,sticky,skip_taskbar,skip_pager", + +own_window_argb_visual=true, +own_window_argb_value=0, + + +------------------------------------- +-- Text Settings +------------------------------------- +use_xft=true, +xftalpha=1, +font="Droid Sans:size=10", +text_buffer_size=256, +override_utf8_locale=true, + + +------------------------------------- +-- Color Scheme +------------------------------------- +default_color="FFFFFF", + +color0="FFFFFF", -- hours +color1="FFFFFF", -- clock dots +color2="FFFFFF", -- minutes +color3="FFFFFF", -- week day +color4="FFFFFF", -- month day +color5="FFFFFF", -- month +color6="FFFFFF", -- current temp +color7="FFFFFF", -- min temp +color8="FFFFFF", -- max temp +color9="FFFFFF", -- current conditions + + +------------------------------------- +-- Icon Sources +------------------------------------- +template0="~/.jelly-conky/#fff__64", + + +------------------------------------- +-- API Key +------------------------------------- +template6="$OWM_KEY", + + +------------------------------------- +-- City ID +------------------------------------- +template7="1846918", + + +------------------------------------- +-- Temp Unit (default, metric, imperial) +------------------------------------- +template8="metric", + + +------------------------------------- +-- Locale (e.g. "es_ES.UTF-8") +-- Leave empty for default +------------------------------------- +template9="$LANG" + +} + + +------------------------------------- +------------------------------------- + + +conky.text = [[ +\ +\ +${execi 300 ~/.jelly-conky/get_weather ${template6} ${template7} ${template8} ${template9}}\ +\ +\ +\ +\ +${font Roboto:size=64}${color0}\ +${alignc}${time %H}\ +\ +\ +\ +\ +${font Roboto:thin:size=64}${color1}:\ +\ +\ +\ +\ +${font Roboto:thin:size=64}${color2}\ +${time %M}${font}${color} +\ +\ +\ +\ +${font Noto Sans CJK JP:light:size=16}${color3}\ +${voffset 12}${alignc}${execi 300 LANG=${template9} LC_TIME=${template9} date +"%A"}${color}, \ +\ +\ +\ +\ +${font Noto Sans CJK JP:light:size=16}${color5}\ +${alignc}${execi 300 LANG=${template9} LC_TIME=${template9} date +"%B"}${color} \ +\ +\ +\ +\ +${font Noto Sans CJK JP:size=16}${color4}\ +${alignc}${execi 300 LANG=${template9} LC_TIME=${template9} date +"%d"}${color}日 +\ +\ +\ +\ +${font Roboto:light:size=24}${color6}\ +${goto 70}${voffset 18}\ +${execi 300 jq ".main.temp" ~/.cache/jelly-conky/weather.json | awk '{print int($1+0.5)}' # round num}°${font}${color} +\ +\ +\ +\ +${font Roboto:light:size=12}\ +${goto 70}${voffset 5}\ +${color7}${execi 300 ~/.jelly-conky/parse_weather 'avg' '.main.temp_min' '0'}° ${color}| \ +${color8}${execi 300 ~/.jelly-conky/parse_weather 'avg' '.main.temp_max' '0'}°${font}${color} +\ +\ +\ +\ +${font Noto Sans CJK JP:light:size=12}${color9}\ +${goto 70}${voffset 5}\ +${execi 300 jq -r ".weather[0].description" ~/.cache/jelly-conky/weather.json}${font}${color} +\ +\ +\ +\ +${execi 300 cp -f ${template0}/$(jq .weather[0].id ~/.cache/jelly-conky/weather.json).png ~/.cache/jelly-conky/current.png}${image ~/.cache/jelly-conky/current.png -p 236,270 -s 128x128}\ +]] diff --git a/linux-hidpi/dconf/user b/linux-hidpi/dconf/user index ecead0ee93233e126f93f89bd8b983a645f3970f..0e06331130409de69441b5af56de5e7c3f38443c 100644 GIT binary patch literal 11328 zcma)?37k~bm4_b!(k!y5D4W`D&_te9)m2?x-4N17L{wD74I`0$Rqs{zliI9TMK`Ds zmuMqsP{e&9E{G-yMx&x87^4mo%>*;~84^sUqsE^`V@PBo369S9e^uRG)k0=UKhD2S z-M8I)?z!haIQcv)?^>CHQT~j>ZaUciQujjHw;y&O3@)=jb{LE(GYWek=&=5b#dk=V z@z@D)IMl*XWsbofTV^tL3QUFLU>Y0`0SG~T1z~igOaoRlLac&j^mLf94`$+Tfv>}f zWoBV3na%e(a4MYEk2CmwCd{kgEOZZNqs4i!04{)URB$0$EZhf+@V7z&Y;d3*E-sV8 zrYp#xvyg*JAYaDA7GX&R9ca;6!BVtXR_1c-w_te%SE8?itKk~Bwt^LCaebMUSg{Ij zfbYN>xCPe2trgsXz6;rH|OA&mVY;P4_vf; z#he=a(g$#!nz5W4e*eJm-|BkOBWWMRMj`m^n;t$Czx1K_=V8x=AHMk4L6h)H>wa3X zDHwXfo~cLSmmW>~<=Cs`{~|K}I{eauY2Sri1qZC(IdvR<=`pllhg}cxy5CRSAHTHj z|3&QU@M!CUpAW<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ToqV2K>Py^Q~u_Gy#{H98j+BPZ5f2{YcVO}a^`1%b|$d_DAcAd$X zLOryOdi(W`raw4-Y4@HMBMxY9pRT)m;wAvbiMB4kbh9W(bzqFKZ#|__@=jsy*BA zF3M$;a)!2@r(rzKwPt|cSKJHTGfZ24@rG@>Vt339%|U~etnE=CU|g@SS$2TR?&Rf` zY^EU)2vkbNKq+k%oq#u}JLg}PS2AyzUJh7xv*nhpQ#pvr^^|uGPMP-S4Q~n!rWgJF z3oTyO^GvCyLCh<2!_MT})&i3h=NJWxy$=t5T<=ihz-e)k23v<@(Jkwl>0rC3*z~c% zRF@r`SDnYBzw`7r%54i>!OA(AP=m%_L$D$1(Jl~UJ|k*+0c z8@jBtUCY*WEgNnq6utdxw^K&D7K=0#d3;#pE$DX9UF38tUf;ENT|;}K>3Z>4*J9Cz zoKx0P*0of;YpMDMZ+p_UOz2?uw6$TZ!P{PSD|E1D+6u)R7>n%ntzx%wwZ>SU^RDHY z@fXHFjp|+(^jg&GzFt4;^TYRgw0TgqJof-NY$f=o(9+# zHW1PKgw<%<8zq(T_p3BZ_q?NLdZW@&OYcFl(}P&sKDx`Jtg(ti4(1VVw!-(GlA&_7 zp9e!UG&!(`omwr0I?B}^vYa*w9p%DaId1ecV*gM3^mNsTU$2OFo*=(0?e|;fowvsUlxTEv+QbLE|1Rv%bx-tkfv8{a=poxl z8y-G>x%xwvi*+d%Yb(b9HkIG~9ScPYtSdZP_PpA~4_+tk9p7cA*Y@9%B{&DEpuLYe zZB`PIV5*kK<$BWzI$>U0@dhszjYLhmp7)BWm>o%l~YXz5+UA^N7~+)oLQv?t#{n%}oT(J43= -floor(float(BAR_WIDTH) / 2)) { /* if not in gap */ + s = dx / section; + p = (sign(s) == 1.0 ? ceil(s) : floor(s)) / float(nbars / 2); /* position, (-1.0F, 1.0F)) */ + p += sign(p) * ((0.5F + center) / AREA_WIDTH); /* index center of bar position */ + /* Apply smooth function and index texture */ + #define smooth_f(tex, p) smooth_audio(tex, audio_sz, p) + float v; + /* ignore out of bounds values */ + if (p > 1.0F || p < -1.0F) { + fragment = vec4(0, 0, 0, 0); + return; + } + /* handle user options and store result of indexing in 'v' */ + if (p > 0.0F) { + #if DIRECTION == 1 + p = 1.0F - p; + #endif + #if INVERT > 0 + v = smooth_f(audio_l, p); + #else + v = smooth_f(audio_r, p); + #endif + } else { + p = abs(p); + #if DIRECTION == 1 + p = 1.0F - p; + #endif + #if INVERT > 0 + v = smooth_f(audio_r, p); + #else + v = smooth_f(audio_l, p); + #endif + } + #undef smooth_f + + v *= AMPLIFY; /* amplify result */ + if (d < v - BAR_OUTLINE_WIDTH) { /* if within range of the reported frequency, draw */ + #if BAR_OUTLINE_WIDTH > 0 + if (md < (BAR_WIDTH / 2) - BAR_OUTLINE_WIDTH) + fragment = COLOR; + else + fragment = BAR_OUTLINE; + #else + fragment = COLOR; + #endif + return; + } + + #if BAR_OUTLINE_WIDTH > 0 + if (d <= v) { + fragment = BAR_OUTLINE; + return; + } + #endif + } + fragment = vec4(0, 0, 0, 0); /* default frag color */ +} diff --git a/linux-hidpi/glava/circle.glsl b/linux-hidpi/glava/circle.glsl new file mode 100755 index 0000000..83b8ad3 --- /dev/null +++ b/linux-hidpi/glava/circle.glsl @@ -0,0 +1,24 @@ +/* center radius (pixels) */ +#define C_RADIUS 128 +/* center line thickness (pixels) */ +#define C_LINE 1.5 +/* outline color */ +#define OUTLINE #333333 +/* Amplify magnitude of the results each bar displays */ +#define AMPLIFY 150 +/* Angle (in radians) for how much to rotate the visualizer */ +#define ROTATE (PI / 2) +/* Whether to switch left/right audio buffers */ +#define INVERT 0 +/* Whether to fill in the space between the line and inner circle */ +#define C_FILL 0 +/* Whether to apply a post-processing image smoothing effect + 1 to enable, 0 to disable. Only works with `xroot` transparency, + and improves performance if disabled. */ +#define C_SMOOTH 1 + +/* Gravity step, overrude frin `smooth_parameters.glsl` */ +#request setgravitystep 6.0 + +/* Smoothing factor, override from `smooth_parameters.glsl` */ +#request setsmoothfactor 0.01 diff --git a/linux-hidpi/glava/circle/1.frag b/linux-hidpi/glava/circle/1.frag new file mode 100644 index 0000000..6caccd1 --- /dev/null +++ b/linux-hidpi/glava/circle/1.frag @@ -0,0 +1,84 @@ +layout(pixel_center_integer) in vec4 gl_FragCoord; + +#request uniform "screen" screen +uniform ivec2 screen; + +#request uniform "audio_sz" audio_sz +uniform int audio_sz; + +#include ":util/smooth.glsl" +#include "@circle.glsl" +#include ":circle.glsl" + +#request uniform "audio_l" audio_l +#request transform audio_l "window" +#request transform audio_l "fft" +#request transform audio_l "gravity" +#request transform audio_l "avg" +uniform sampler1D audio_l; + +#request uniform "audio_r" audio_r +#request transform audio_r "window" +#request transform audio_r "fft" +#request transform audio_r "gravity" +#request transform audio_r "avg" +uniform sampler1D audio_r; + +out vec4 fragment; + +#define TWOPI 6.28318530718 +#define PI 3.14159265359 + +/* This shader is based on radial.glsl, refer to it for more commentary */ + +float apply_smooth(float theta) { + float idx = theta + ROTATE; + float dir = mod(abs(idx), TWOPI); + if (dir > PI) + idx = -sign(idx) * (TWOPI - dir); + if (INVERT > 0) + idx = -idx; + + float pos = abs(idx) / (PI + 0.001F); + #define smooth_f(tex) smooth_audio(tex, audio_sz, pos) + float v; + if (idx > 0) v = smooth_f(audio_l); + else v = smooth_f(audio_r); + v *= AMPLIFY; + #undef smooth_f + return v; +} + +void main() { + fragment = vec4(0, 0, 0, 0); + float + dx = gl_FragCoord.x - (screen.x / 2), + dy = gl_FragCoord.y - (screen.y / 2); + float theta = atan(dy, dx); + float d = sqrt((dx * dx) + (dy * dy)); + float adv = (1.0F / d) * (C_LINE * 0.5); + float + adj0 = theta + adv, + adj1 = theta - adv; + d -= C_RADIUS; + if (d >= -(float(C_LINE) / 2.0F)) { + float v = apply_smooth(theta); + + adj0 = apply_smooth(adj0) - v; + adj1 = apply_smooth(adj1) - v; + + float + dmax = max(adj0, adj1), + dmin = min(adj0, adj1); + + d -= v; + #if C_FILL > 0 + #define BOUNDS (d < (float(C_LINE) / 2.0F)) + #else + #define BOUNDS (d > -(float(C_LINE) / 2.0F) && d < (float(C_LINE) / 2.0F)) || (d <= dmax && d >= dmin) + #endif + if (BOUNDS) { + fragment = OUTLINE; + } + } +} diff --git a/linux-hidpi/glava/circle/2.frag b/linux-hidpi/glava/circle/2.frag new file mode 100644 index 0000000..d38f6ad --- /dev/null +++ b/linux-hidpi/glava/circle/2.frag @@ -0,0 +1,33 @@ + +in vec4 gl_FragCoord; + +#request uniform "prev" tex +uniform sampler2D tex; /* screen texture */ + +out vec4 fragment; /* output */ + +#include "@circle.glsl" +#include ":circle.glsl" + +void main() { + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0); + #if C_SMOOTH > 0 + #if USE_ALPHA + vec4 + a0 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + a1 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 1)), 0), + a2 = texelFetch(tex, ivec2((gl_FragCoord.x + 0), (gl_FragCoord.y + 1)), 0), + a3 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + + a4 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0), + a5 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 1)), 0), + a6 = texelFetch(tex, ivec2((gl_FragCoord.x - 0), (gl_FragCoord.y - 1)), 0), + a7 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0); + + vec4 avg = (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7) / 8.0; + if (fragment.a == 0) { + fragment = avg; + } + #endif + #endif +} diff --git a/linux-hidpi/glava/circle/3.frag b/linux-hidpi/glava/circle/3.frag new file mode 100644 index 0000000..66f7cd9 --- /dev/null +++ b/linux-hidpi/glava/circle/3.frag @@ -0,0 +1 @@ +#include ":util/premultiply.frag" diff --git a/linux-hidpi/glava/env_KWin.glsl b/linux-hidpi/glava/env_KWin.glsl new file mode 100755 index 0000000..aa168ba --- /dev/null +++ b/linux-hidpi/glava/env_KWin.glsl @@ -0,0 +1,8 @@ +#request setdecorated false +#request setxwintype "normal" +#request addxwinstate "below" +#request addxwinstate "skip_taskbar" +#request addxwinstate "skip_pager" +#request addxwinstate "pinned" +#request setclickthrough true + diff --git a/linux-hidpi/glava/env_Openbox.glsl b/linux-hidpi/glava/env_Openbox.glsl new file mode 100755 index 0000000..c95c616 --- /dev/null +++ b/linux-hidpi/glava/env_Openbox.glsl @@ -0,0 +1,2 @@ +#request setxwintype "desktop" +#request addxwinstate "pinned" diff --git a/linux-hidpi/glava/env_Xfwm4.glsl b/linux-hidpi/glava/env_Xfwm4.glsl new file mode 100755 index 0000000..1c20359 --- /dev/null +++ b/linux-hidpi/glava/env_Xfwm4.glsl @@ -0,0 +1,3 @@ +#request setxwintype "desktop" +#request addxwinstate "pinned" +#request addxwinstate "below" diff --git a/linux-hidpi/glava/env_awesome.glsl b/linux-hidpi/glava/env_awesome.glsl new file mode 100755 index 0000000..7f2bba3 --- /dev/null +++ b/linux-hidpi/glava/env_awesome.glsl @@ -0,0 +1 @@ +#request setxwintype "!-" diff --git a/linux-hidpi/glava/env_default.glsl b/linux-hidpi/glava/env_default.glsl new file mode 100755 index 0000000..90336cc --- /dev/null +++ b/linux-hidpi/glava/env_default.glsl @@ -0,0 +1 @@ +#request setxwintype "desktop" diff --git a/linux-hidpi/glava/env_i3.glsl b/linux-hidpi/glava/env_i3.glsl new file mode 100755 index 0000000..7f2bba3 --- /dev/null +++ b/linux-hidpi/glava/env_i3.glsl @@ -0,0 +1 @@ +#request setxwintype "!-" diff --git a/linux-hidpi/glava/graph.glsl b/linux-hidpi/glava/graph.glsl new file mode 100755 index 0000000..546d8d4 --- /dev/null +++ b/linux-hidpi/glava/graph.glsl @@ -0,0 +1,31 @@ + +/* Vertical scale, larger values will amplify output */ +#define VSCALE 300 +/* Rendering direction, either -1 (outwards) or 1 (inwards). */ +#define DIRECTION 1 + +/* Color gradient scale, (optionally) used in `COLOR` macro */ +#define GRADIENT_SCALE 75 +/* Color definition. By default this is a gradient formed by mixing two colors. + `pos` represents the pixel position relative to the visualizer baseline. */ +#define COLOR mix(#802A2A, #4F4F92, clamp(pos / GRADIENT_SCALE, 0, 1)) +/* 1 to draw outline, 0 to disable */ +#define DRAW_OUTLINE 0 +/* 1 to draw edge highlight, 0 to disable */ +#define DRAW_HIGHLIGHT 1 +/* Whether to anti-alias the border of the graph, creating a smoother curve. + This may have a small impact on performance. + Note: requires `xroot` or `none` opacity to be set */ +#define ANTI_ALIAS 0 +/* outline color */ +#define OUTLINE #262626 +/* 1 to join the two channels together in the middle, 0 to clamp both down to zero */ +#define JOIN_CHANNELS 0 +/* 1 to invert (vertically), 0 otherwise */ +#define INVERT 0 + +/* Gravity step, overrude from `smooth_parameters.glsl` */ +#request setgravitystep 2.4 + +/* Smoothing factor, override from `smooth_parameters.glsl` */ +#request setsmoothfactor 0.015 diff --git a/linux-hidpi/glava/graph/1.frag b/linux-hidpi/glava/graph/1.frag new file mode 100644 index 0000000..9b82d05 --- /dev/null +++ b/linux-hidpi/glava/graph/1.frag @@ -0,0 +1,132 @@ + +layout(pixel_center_integer) in vec4 gl_FragCoord; + +#request uniform "screen" screen +uniform ivec2 screen; /* screen dimensions */ + +#request uniform "audio_sz" audio_sz +uniform int audio_sz; + +/* When we transform our audio, we need to go through the following steps: + + transform -> "window" + First, apply a window function to taper off the ends of the spectrum, helping + avoid artifacts in the FFT output. + + transform -> "fft" + Apply the Fast Fourier Transform algorithm to separate raw audio data (waves) + into their respective spectrums. + + transform -> "fft" + As part of the FFT process, we return spectrum magnitude on a log(n) scale, + as this is how the (decibel) dB scale functions. + + transform -> "gravity" + To help make our data more pleasing to look at, we apply our data received over + time to a buffer, taking the max of either the existing value in the buffer or + the data from the input. We then reduce the data by the 'gravity step', and + return the storage buffer. + + This makes frequent and abrupt changes in frequency less distracting, and keeps + short frequency responses on the screen longer. + + transform -> "avg" + As a final step, we take the average of several data frames (specified by + 'setavgframes') and return the result to further help smooth the resulting + animation. In order to mitigate abrupt changes to the average, the values + at each end of the average buffer can be weighted less with a window function + (the same window function used at the start of this step!). It can be disabled + with 'setavgwindow'. +*/ + +#include ":util/smooth.glsl" +#include "@graph.glsl" +#include ":graph.glsl" + +#request uniform "audio_l" audio_l +#request transform audio_l "window" +#request transform audio_l "fft" +#request transform audio_l "gravity" +#request transform audio_l "avg" +uniform sampler1D audio_l; + +#request uniform "audio_r" audio_r +#request transform audio_r "window" +#request transform audio_r "fft" +#request transform audio_r "gravity" +#request transform audio_r "avg" +uniform sampler1D audio_r; + +out vec4 fragment; + +/* distance from center */ +#define CDIST (abs((screen.x / 2) - gl_FragCoord.x) / screen.x) +/* distance from sides (far) */ +#define FDIST (min(gl_FragCoord.x, screen.x - gl_FragCoord.x) / screen.x) + +#if DIRECTION < 0 +#define LEFT_IDX (gl_FragCoord.x) +#define RIGHT_IDX (-gl_FragCoord.x + screen.x) +/* distance from base frequencies */ +#define BDIST FDIST +/* distance from high frequencies */ +#define HDIST CDIST +#else +#define LEFT_IDX (half_w - gl_FragCoord.x) +#define RIGHT_IDX (gl_FragCoord.x - half_w) +#define BDIST CDIST +#define HDIST FDIST +#endif + +#define TWOPI 6.28318530718 + +float half_w; +float middle; +highp float pixel = 1.0F / float(screen.x); + +float get_line_height(in sampler1D tex, float idx) { + float s = smooth_audio_adj(tex, audio_sz, idx / half_w, pixel); + /* scale the data upwards so we can see it */ + s *= VSCALE; + /* clamp far ends of the screen down to make the ends of the graph smoother */ + + float fact = clamp((abs((screen.x / 2) - gl_FragCoord.x) / screen.x) * 48, 0.0F, 1.0F); + #if JOIN_CHANNELS > 0 + fact = -2 * pow(fact, 3) + 3 * pow(fact, 2); /* To avoid spikes */ + s = fact * s + (1 - fact) * middle; + #else + s *= fact; + #endif + + s *= clamp((min(gl_FragCoord.x, screen.x - gl_FragCoord.x) / screen.x) * 48, 0.0F, 1.0F); + + return s; +} + +void render_side(in sampler1D tex, float idx) { + float s = get_line_height(tex, idx); + + /* and finally set fragment color if we are in range */ + #if INVERT > 0 + float pos = float(screen.y) - gl_FragCoord.y; + #else + float pos = gl_FragCoord.y; + #endif + if (pos + 1.5 <= s) { + fragment = COLOR; + } else { + fragment = vec4(0, 0, 0, 0); + } +} + +void main() { + half_w = (screen.x / 2); + + middle = VSCALE * (smooth_audio_adj(audio_l, audio_sz, 1, pixel) + smooth_audio_adj(audio_r, audio_sz, 0, pixel)) / 2; + + if (gl_FragCoord.x < half_w) { + render_side(audio_l, LEFT_IDX); + } else { + render_side(audio_r, RIGHT_IDX); + } +} diff --git a/linux-hidpi/glava/graph/2.frag b/linux-hidpi/glava/graph/2.frag new file mode 100644 index 0000000..ff18445 --- /dev/null +++ b/linux-hidpi/glava/graph/2.frag @@ -0,0 +1,44 @@ + +in vec4 gl_FragCoord; + +#request uniform "prev" tex +uniform sampler2D tex; /* screen texture */ + +out vec4 fragment; /* output */ + +#include "@graph.glsl" +#include ":graph.glsl" + +#if DRAW_OUTLINE == 0 && DRAW_HIGHLIGHT == 0 +#error __disablestage +#endif + +void main() { + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0); + + vec4 + a0 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + a1 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 1)), 0), + a2 = texelFetch(tex, ivec2((gl_FragCoord.x + 0), (gl_FragCoord.y + 1)), 0), + a3 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + + a4 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0), + a5 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 1)), 0), + a6 = texelFetch(tex, ivec2((gl_FragCoord.x - 0), (gl_FragCoord.y - 1)), 0), + a7 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0); + + vec4 avg = (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7) / 8.0; + if (avg.a > 0){ + if (fragment.a <= 0) { + /* outline */ + #if DRAW_OUTLINE > 0 + fragment = OUTLINE; + #endif + } else if (avg.a < 1) { + /* creates a highlight along the edge of the spectrum */ + #if DRAW_HIGHLIGHT > 0 + fragment.rgb *= avg.a * 2; + #endif + } + } +} diff --git a/linux-hidpi/glava/graph/3.frag b/linux-hidpi/glava/graph/3.frag new file mode 100644 index 0000000..2263139 --- /dev/null +++ b/linux-hidpi/glava/graph/3.frag @@ -0,0 +1,104 @@ + +in vec4 gl_FragCoord; + +#request uniform "screen" screen +uniform ivec2 screen; /* screen dimensions */ + +#request uniform "prev" tex +uniform sampler2D tex; /* screen texture */ + +out vec4 fragment; /* output */ + +#include "@graph.glsl" +#include ":graph.glsl" + +#if ANTI_ALIAS == 0 +#error __disablestage +#endif + +/* Moves toward the border of the graph, gives the + y coordinate of the last colored pixel */ +float get_col_height_up(float x, float oy) { + float y = oy; + #if INVERT > 0 + while (y >= 0) { + #else + while (y < screen.y) { + #endif + vec4 f = texelFetch(tex, ivec2(x, y), 0); + if (f.a <= 0) { + #if INVERT > 0 + y += 1; + #else + y -= 1; + #endif + break; + } + #if INVERT > 0 + y -= 1; + #else + y += 1; + #endif + } + + return y; +} + +/* Moves toward the base of the graph, gives the + y coordinate of the first colored pixel */ +float get_col_height_down(float x, float oy) { + float y = oy; + #if INVERT > 0 + while (y < screen.y) { + #else + while (y >= 0) { + #endif + vec4 f = texelFetch(tex, ivec2(x, y), 0); + if (f.a > 0) { + break; + } + #if INVERT > 0 + y += 1; + #else + y -= 1; + #endif + } + + return y; +} + +void main() { + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0); + + #if ANTI_ALIAS > 0 + + if (fragment.a <= 0) { + bool left_done = false; + float h2; + float a_fact = 0; + + if (texelFetch(tex, ivec2(gl_FragCoord.x - 1, gl_FragCoord.y), 0).a > 0) { + float h1 = get_col_height_up(gl_FragCoord.x - 1, gl_FragCoord.y); + h2 = get_col_height_down(gl_FragCoord.x, gl_FragCoord.y); + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, h2), 0); + + a_fact = clamp(abs((h1 - gl_FragCoord.y) / (h2 - h1)), 0.0, 1.0); + + left_done = true; + } + if (texelFetch(tex, ivec2(gl_FragCoord.x + 1, gl_FragCoord.y), 0).a > 0) { + if (!left_done) { + h2 = get_col_height_down(gl_FragCoord.x, gl_FragCoord.y); + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, h2), 0); + } + float h3 = get_col_height_up(gl_FragCoord.x + 1, gl_FragCoord.y); + + a_fact = max(a_fact, clamp(abs((h3 - gl_FragCoord.y) / (h2 - h3)), 0.0, 1.0)); + } + + fragment.a *= a_fact; + + } + + #endif +} diff --git a/linux-hidpi/glava/radial.glsl b/linux-hidpi/glava/radial.glsl new file mode 100755 index 0000000..37f2635 --- /dev/null +++ b/linux-hidpi/glava/radial.glsl @@ -0,0 +1,39 @@ + +/* center radius (pixels) */ +#define C_RADIUS 720 +/* center line thickness (pixels) */ +#define C_LINE 0 +/* outline color */ +#define OUTLINE #ffffff +/* number of bars (use even values for best results) */ +#define NBARS 360 +/* width (in pixels) of each bar*/ +#define BAR_WIDTH 8 +/* outline color */ +#define BAR_OUTLINE OUTLINE +/* outline width (in pixels, set to 0 to disable outline drawing) */ +#define BAR_OUTLINE_WIDTH 0 +/* Amplify magnitude of the results each bar displays */ +#define AMPLIFY 200 +/* Bar color */ +#define COLOR #ffffff +/* Angle (in radians) for how much to rotate the visualizer */ +#define ROTATE (PI / 2) +/* Whether to switch left/right audio buffers */ +#define INVERT 0 +/* Aliasing factors. Higher values mean more defined and jagged lines. + Note: aliasing does not have a notable impact on performance, but requires + `xroot` transparency to be enabled since it relies on alpha blending with + the background. */ +#define BAR_ALIAS_FACTOR 1.2 +#define C_ALIAS_FACTOR 1.8 +/* Offset (Y) of the visualization */ +#define CENTER_OFFSET_Y 0 +/* Offset (X) of the visualization */ +#define CENTER_OFFSET_X 0 + +/* Gravity step, override from `smooth_parameters.glsl` */ +#request setgravitystep 5.0 + +/* Smoothing factor, override from `smooth_parameters.glsl` */ +#request setsmoothfactor 0.02 diff --git a/linux-hidpi/glava/radial/1.frag b/linux-hidpi/glava/radial/1.frag new file mode 100644 index 0000000..3951a37 --- /dev/null +++ b/linux-hidpi/glava/radial/1.frag @@ -0,0 +1,115 @@ +in vec4 gl_FragCoord; + +#request uniform "screen" screen +uniform ivec2 screen; + +#request uniform "audio_sz" audio_sz +uniform int audio_sz; + +#include ":util/smooth.glsl" +#include "@radial.glsl" +#include ":radial.glsl" + +#request uniform "audio_l" audio_l +#request transform audio_l "window" +#request transform audio_l "fft" +#request transform audio_l "gravity" +#request transform audio_l "avg" +uniform sampler1D audio_l; + +#request uniform "audio_r" audio_r +#request transform audio_r "window" +#request transform audio_r "fft" +#request transform audio_r "gravity" +#request transform audio_r "avg" +uniform sampler1D audio_r; + +out vec4 fragment; + +#define TWOPI 6.28318530718 +#define PI 3.14159265359 + +void main() { + + #if USE_ALPHA > 0 + #define APPLY_FRAG(f, c) f = vec4(f.rgb * f.a + c.rgb * (1 - clamp(f.a, 0, 1)), max(c.a, f.a)) + fragment = #00000000; + #else + #define APPLY_FRAG(f, c) f = c + #endif + + /* To handle jagged edges, we alias in the shader by using alpha layer blending. + Alpha layer blending is only applied when `xroot` transparency is enabled. */ + + float /* translate (x, y) to use (0, 0) as the center of the screen */ + dx = gl_FragCoord.x - (screen.x / 2) + CENTER_OFFSET_X, + dy = gl_FragCoord.y - (screen.y / 2) + CENTER_OFFSET_Y; + float theta = atan(dy, dx); /* fragment angle with the center of the screen as the origin */ + float d = sqrt((dx * dx) + (dy * dy)); /* distance */ + if (d > C_RADIUS - (float(C_LINE) / 2.0F) && d < C_RADIUS + (float(C_LINE) / 2.0F)) { + APPLY_FRAG(fragment, OUTLINE); + #if USE_ALPHA > 0 + fragment.a *= clamp(((C_LINE / 2) - abs(C_RADIUS - d)) * C_ALIAS_FACTOR, 0, 1); + #else + return; /* return immediately if there is no alpha blending available */ + #endif + } + if (d > C_RADIUS) { + const float section = (TWOPI / NBARS); /* range (radians) for each bar */ + const float center = ((TWOPI / NBARS) / 2.0F); /* center line angle */ + float m = mod(theta, section); /* position in section (radians) */ + float ym = d * sin(center - m); /* distance from center line (cartesian coords) */ + if (abs(ym) < BAR_WIDTH / 2) { /* if within width, draw audio */ + float idx = theta + ROTATE; /* position (radians) in texture */ + float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */ + if (dir > PI) + idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */ + if (INVERT > 0) + idx = -idx; /* Invert if needed */ + float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */ + #define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */ + float v; + if (idx > 0) v = smooth_f(audio_l); /* left buffer */ + else v = smooth_f(audio_r); /* right buffer */ + v *= AMPLIFY; /* amplify */ + #undef smooth_f + /* offset to fragment distance from inner circle */ + #if USE_ALPHA > 0 + #define ALIAS_FACTOR (((BAR_WIDTH / 2) - abs(ym)) * BAR_ALIAS_FACTOR) + d -= C_RADIUS; /* start bar overlapping the inner circle for blending */ + #else + #define ALIAS_FACTOR 1 + d -= C_RADIUS + (float(C_LINE) / 2.0F); /* start bar after circle */ + #endif + if (d <= v - BAR_OUTLINE_WIDTH) { + vec4 r; + #if BAR_OUTLINE_WIDTH > 0 + if (abs(ym) < (BAR_WIDTH / 2) - BAR_OUTLINE_WIDTH) + r = COLOR; + else + r = BAR_OUTLINE; + #else + r = COLOR; + #endif + #if USE_ALPHA > 0 + r.a *= ALIAS_FACTOR; + #endif + APPLY_FRAG(fragment, r); + return; + } + #if BAR_OUTLINE_WIDTH > 0 + if (d <= v) { + #if USE_ALPHA > 0 + vec4 r = BAR_OUTLINE; + r.a *= ALIAS_FACTOR; + APPLY_FRAG(fragment, r); + #else + APPLY_FRAG(fragment, BAR_OUTLINE); + #endif + return; + } + #endif + } + } + fragment = APPLY_FRAG(fragment, vec4(0, 0, 0, 0)); /* default frag color */ +} diff --git a/linux-hidpi/glava/radial/2.frag b/linux-hidpi/glava/radial/2.frag new file mode 100644 index 0000000..66f7cd9 --- /dev/null +++ b/linux-hidpi/glava/radial/2.frag @@ -0,0 +1 @@ +#include ":util/premultiply.frag" diff --git a/linux-hidpi/glava/rc.glsl b/linux-hidpi/glava/rc.glsl new file mode 100755 index 0000000..1135d94 --- /dev/null +++ b/linux-hidpi/glava/rc.glsl @@ -0,0 +1,227 @@ + +/* The module to use. A module is a set of shaders used to produce + the visualizer. The structure for a module is the following: + + module_name [directory] + 1.frag [file: fragment shader], + 2.frag [file: fragment shader], + ... + + Shaders are loaded in numerical order, starting at '1.frag', + continuing indefinitely. The results of each shader (except + for the final pass) is given to the next shader in the list + as a 2D sampler. + + See documentation for more details. */ +#request mod radial + +/* Window hints */ +#request setfloating false +#request setdecorated true +#request setfocused false +#request setmaximized false + +/* Set window background opacity mode. Possible values are: + + "native" - True transparency provided by the compositor. Can + reduce performance on some systems, depending on + the compositor used. + + "xroot" - Maintain a copy of the root window's pixmap + (usually the desktop background) to provide a + pseudo-transparent effect. Useful when no compositor + is available or native transparency isn't nessecary. + Has very little performance impact. + + "none" - Disable window opacity completely. */ +#request setopacity "native" + +/* Whether to mirror left and right audio input channels from PulseAudio.*/ +#request setmirror false + +/* OpenGL context and GLSL shader versions, do not change unless + you *absolutely* know what you are doing. */ +#request setversion 3 3 +#request setshaderversion 330 + +/* Window title */ +#request settitle "GLava" + +/* Window geometry (x, y, width, height) */ +#request setgeometry 0 0 2880 1800 + +/* Window background color (RGB format). + Does not work with `setopacity "xroot"` */ +#request setbg 00000000 + +/* (X11 only) EWMH Window type. Possible values are: + + "desktop", "dock", "toolbar", "menu", + "utility", "splash", "dialog", "normal" + + This will set _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_(TYPE), + where (TYPE) is the one of the window types listed (after being + converted to uppercase). + + Alternatively, you can set this value to "!", which will cause + the window to be unmanaged. If this is set, then `addxwinstate` + will do nothing, but you can use "!+" and "!-" to stack on top + or below other windows. +*/ +#request setxwintype "normal" + +/* (X11 only) EWMH Window state atoms (multiple can be specified). + Possible values are: + + "modal", "sticky", "maximized_vert", "maximized_horz", + "shaded", "skip_taskbar", "skip_pager", "hidden", "fullscreen", + "above", "below", "demands_attention", "focused", "pinned" + + This will add _NET_WM_STATE_(TYPE) atoms to _NET_WM_STATE, + where (TYPE) is one of the window states listed (after being + converted to uppercase). + + The lines below (commented out by default) are of relevance + if you are trying to get GLava to behave as a desktop widget + and your WM is not correctly responding to the "desktop" value + for `setxwintype`. +*/ +// #request addxwinstate "sticky" +// #request addxwinstate "skip_taskbar" +// #request addxwinstate "skip_pager" +// #request addxwinstate "above" +// #request addxwinstate "pinned" + +/* (X11 only) Use the XShape extension to support clicking through + the GLava window. Useful when you want to interact with other + desktop windows (icons, menus, desktop shells). Enabled by + default when GLava itself is a desktop window. */ +#request setclickthrough false + +/* Audio source + + When the "pulseaudio" backend is set, this can be a number or + a name of an audio sink or device to record from. Set to "auto" + to use the default output device. + + When the "fifo" backend is set, "auto" is interpreted as + "/tmp/mpd.fifo". Otherwise, a valid path should be provided. */ +#request setsource "auto" + +/* Buffer swap interval (vsync), set to '0' to prevent + waiting for refresh, '1' (or more) to wait for the specified + amount of frames. */ +#request setswap 1 + +/* Linear interpolation for audio data frames. Drastically + improves smoothness with configurations that yield low UPS + (`setsamplerate` and `setsamplesize`), or monitors that have + high refresh rates. + + This feature itself, however, will effect performance as it + will have to interpolate data every frame on the CPU. It will + automatically (and temporarily) disable itself if the update + rate is close to, or higher than the framerate: + + if (update_rate / frame_rate > 0.9) disable_interpolation; + + This will delay data output by one update frame, so it can + desync audio with visual effects on low UPS configs. */ +#request setinterpolate true + +/* Frame limiter, set to the frames per second (FPS) desired or + simply set to zero (or lower) to disable the frame limiter. */ +#request setframerate 0 + +/* Suspends rendering if a fullscreen window is focused while + GLava is still visible (ie. on another monitor). This prevents + rendering from interfering with other graphically intensive + tasks. + + If GLava is minimized or completely obscured, it will not + render regardless of this option. */ +#request setfullscreencheck false + +/* Enable/disable printing framerate every second. 'FPS' stands + for 'Frames Per Second', and 'UPS' stands for 'Updates Per + Second'. Updates are performed when new data is submitted + by pulseaudio, and require transformations to be re-applied + (thus being a good measure of how much work your CPU has to + perform over time) */ +#request setprintframes true + +/* PulseAudio sample buffer size. Lower values result in more + frequent audio updates (also depends on sampling rate), but + will also require all transformations to be applied much + more frequently (CPU intensive). + + High (>2048, with 22050 Hz) values will decrease accuracy + (as some signals can be missed by transformations like FFT) + + The following settings (@22050 Hz) produce the listed rates: + + Sample UPS Description + - 2048 -> 43.0 (low accuracy, cheap), use with < 60 FPS + - 1024 -> 86.1 (high accuracy, expensive), use with >= 60 FPS + - 512 -> 172.3 (extreme accuracy, very expensive), use only + for graphing accurate spectrum data with + custom modules. + + If the framerate drops below the update rate, the update rate + will be locked to the framerate (to prevent wasting CPU time). + This behaviour means you can use a 1024 sample size on a 60Hz + monitor with vsync enabled to get 60FPS and 60UPS. + + For high refresh rate monitors (120+ Hz), it's recommended to + also stick with the 1024 sample size and use interpolation to + smooth the data, as accuracy beyond this setting is mostly + meaningless for visual purposes. +*/ +#request setsamplesize 1024 + +/* Audio buffer size to be used for processing and shaders. + Increasing this value can have the effect of adding 'gravity' + to FFT output, as the audio signal will remain in the buffer + longer. + + This value has a _massive_ effect on FFT performance and + quality for some modules. */ +#request setbufsize 4096 + +/* PulseAudio sample rate. Lower values can add 'gravity' to + FFT output, but can also reduce accuracy. Most hardware + samples at 44100Hz. + + Lower sample rates also can make output more choppy, when + not using interpolation. It's generally OK to leave this + value unless you have a strange PulseAudio configuration. + + This option does nothing when using the "fifo" audio + backend. Instead, an ideal rate should be be configured + in the application generating the output. */ +#request setsamplerate 22050 + +/* ** DEPRECATED ** + Force window geometry (locking the window in place), useful + for some pesky WMs that try to reposition the window when + embedding in the desktop. + + This routinely sends X11 events and should be avoided. */ +#request setforcegeometry false + +/* ** DEPRECATED ** + Force window to be raised (focused in some WMs), useful for + WMs that have their own stacking order for desktop windows. + + This routinely sends X11 events and should be avoided. */ +#request setforceraised false + +/* ** DEPRECATED ** + Scale down the audio buffer before any operations are + performed on the data. Higher values are faster. + + This value can affect the output of various transformations, + since it applies (crude) averaging to the data when shrinking + the buffer. It is reccommended to use `setsamplerate` and + `setsamplesize` to improve performance or accuracy instead. */ +#request setbufscale 1 diff --git a/linux-hidpi/glava/smooth_parameters.glsl b/linux-hidpi/glava/smooth_parameters.glsl new file mode 100755 index 0000000..bfea307 --- /dev/null +++ b/linux-hidpi/glava/smooth_parameters.glsl @@ -0,0 +1,78 @@ + +/* Settings for smoothing functions and transformations commonly + used to display FFT output. + + IMPORTANT: THESE VALUES CAN BE OVERRIDDEN IN MODULE CONFIG + FILES, IF CHANGING VALUES HERE DOES NOT WORK, CHECK + TO MAKE SURE THEY ARE NOT BEING SET ELSEWHERE. +*/ + +/* The type of formula to use for weighting values when smoothing. + Possible values: + + - circular heavily rounded points + - sinusoidal rounded at both low and high weighted values + like a sine wave + - linear not rounded at all; linear distance + */ +#define ROUND_FORMULA sinusoidal + +/* The sampling mode for processing raw FFT input: + + - average averages all the inputs in the sample range for + a given point. Produces smooth output, but peaks + are not well represented + - maximum obtains the best value from the closest peak in + the sample range. Very accurate peaks, but + output is jagged and sporadic. + - hybrid uses the results from both `average` and `maximum` + with the weight provided in `SAMPLE_HYBRID_WEIGHT` */ +#define SAMPLE_MODE average +/* Weight should be provided in the range (0, 1). Higher values favour + averaged results. `hybrid` mode only. */ +#define SAMPLE_HYBRID_WEIGHT 0.65 + +/* Factor used to scale frequencies. Lower values allows lower + frequencies to occupy more space. */ +#define SAMPLE_SCALE 8 + +/* The frequency range to sample. 1.0 would be the entire FFT output, + and lower values reduce the displayed frequencies in a log-like + scale. */ +#define SAMPLE_RANGE 0.9 + +/* Factor for how to scale higher frequencies. Used in a linear equation + which is multiplied by the result of the fft transformation. */ +#request setfftscale 10.2 + +/* Cutoff for the bass end of the audio data when scaling frequencies. + Higher values cause more of the bass frequencies to be skipped when + scaling. */ +#request setfftcutoff 0.3 + +/* How many frames to queue and run through the average function. + Increasing this value will create latency between the audio and the + animation, but will make for much smoother results. */ +#request setavgframes 6 + +/* Whether to window frames ran through the average function (new & old + frames are weighted less). This massively helps smoothing out + spontaneous values in the animation. */ +#request setavgwindow true + +/* Gravity step, higher values means faster drops. The step is applied + in a rate independant method like so: + + val -= (gravitystep) * (seconds per update) */ +#request setgravitystep 4.2 + +/* Smoothing factor. Larger values mean more smoothing in the output, + however high values can be expensive to compute. Values are in + normalized width: [0.0, 1.0) */ +#request setsmoothfactor 0.025 + +/* Whether to use a separate pass for audio data while smoothing. On + most hardware, this will improve performance, but involves doing a + separate render step for each audio texture and will add some driver + (CPU) overhead. */ +#request setsmoothpass true diff --git a/linux-hidpi/glava/util/premultiply.frag b/linux-hidpi/glava/util/premultiply.frag new file mode 100644 index 0000000..4be8846 --- /dev/null +++ b/linux-hidpi/glava/util/premultiply.frag @@ -0,0 +1,17 @@ + +#if PREMULTIPLY_ALPHA == 0 +#error __disablestage +#endif + +#request uniform "prev" tex +uniform sampler2D tex; + +out vec4 fragment; +in vec4 gl_FragCoord; + +void main() { + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0); + #if PREMULTIPLY_ALPHA > 0 + fragment.rgb *= fragment.a; + #endif +} diff --git a/linux-hidpi/glava/util/smooth.glsl b/linux-hidpi/glava/util/smooth.glsl new file mode 100644 index 0000000..5b8a3b4 --- /dev/null +++ b/linux-hidpi/glava/util/smooth.glsl @@ -0,0 +1,97 @@ + +#ifndef _SMOOTH_GLSL /* include gaurd */ +#define _SMOOTH_GLSL + +#ifndef TWOPI +#define TWOPI 6.28318530718 +#endif + +#ifndef PI +#define PI 3.14159265359 +#endif + +#include "@smooth_parameters.glsl" +#include ":smooth_parameters.glsl" + +/* window value t that resides in range [0, sz)*/ +#define window(t, sz) (0.53836 - (0.46164 * cos(TWOPI * t / (sz - 1)))) +/* this does nothing, but we keep it as an option for config */ +#define linear(x) (x) +/* take value x that scales linearly between [0, 1) and return its sinusoidal curve */ +#define sinusoidal(x) ((0.5 * sin((PI * (x)) - (PI / 2))) + 0.5) +/* take value x that scales linearly between [0, 1) and return its circlar curve */ +#define circular(x) sqrt(1 - (((x) - 1) * ((x) - 1))) + +#define average 0 +#define maximum 1 +#define hybrid 2 + +float scale_audio(float idx) { + return -log((-(SAMPLE_RANGE) * idx) + 1) / (SAMPLE_SCALE); +} + +float iscale_audio(float idx) { + return -log((SAMPLE_RANGE) * idx) / (SAMPLE_SCALE); +} + +/* Note: the SMOOTH_FACTOR macro is defined by GLava itself, from `#request setsmoothfactor`*/ + +float smooth_audio(in sampler1D tex, int tex_sz, highp float idx) { + + #if PRE_SMOOTHED_AUDIO < 1 + float + smin = scale_audio(clamp(idx - SMOOTH_FACTOR, 0, 1)) * tex_sz, + smax = scale_audio(clamp(idx + SMOOTH_FACTOR, 0, 1)) * tex_sz; + float m = ((smax - smin) / 2.0F), s, w; + float rm = smin + m; /* middle */ + + #if SAMPLE_MODE == average + float avg = 0, weight = 0; + for (s = smin; s <= smax; s += 1.0F) { + w = ROUND_FORMULA(clamp((m - abs(rm - s)) / m, 0, 1)); + weight += w; + avg += texelFetch(tex, int(round(s)), 0).r * w; + } + avg /= weight; + return avg; + #elif SAMPLE_MODE == hybrid + float vmax = 0, avg = 0, weight = 0, v; + for (s = smin; s < smax; s += 1.0F) { + w = ROUND_FORMULA(clamp((m - abs(rm - s)) / m, 0, 1)); + weight += w; + v = texelFetch(tex, int(round(s)), 0).r * w; + avg += v; + if (vmax < v) + vmax = v; + } + return (vmax * (1 - SAMPLE_HYBRID_WEIGHT)) + ((avg / weight) * SAMPLE_HYBRID_WEIGHT); + #elif SAMPLE_MODE == maximum + float vmax = 0, v; + for (s = smin; s < smax; s += 1.0F) { + w = texelFetch(tex, int(round(s)), 0).r * ROUND_FORMULA(clamp((m - abs(rm - s)) / m, 0, 1)); + if (vmax < w) + vmax = w; + } + return vmax; + #endif + #else + return texelFetch(tex, int(round(idx * tex_sz)), 0).r; + #endif +} + +/* Applies the audio smooth sampling function three times to the adjacent values */ +float smooth_audio_adj(in sampler1D tex, int tex_sz, highp float idx, highp float pixel) { + float + al = smooth_audio(tex, tex_sz, max(idx - pixel, 0.0F)), + am = smooth_audio(tex, tex_sz, idx), + ar = smooth_audio(tex, tex_sz, min(idx + pixel, 1.0F)); + return (al + am + ar) / 3.0F; +} + +#ifdef TWOPI +#undef TWOPI +#endif +#ifdef PI +#undef PI +#endif +#endif /* _SMOOTH_GLSL */ diff --git a/linux-hidpi/glava/util/smooth_pass.frag b/linux-hidpi/glava/util/smooth_pass.frag new file mode 100644 index 0000000..b55d0f6 --- /dev/null +++ b/linux-hidpi/glava/util/smooth_pass.frag @@ -0,0 +1,16 @@ + +uniform sampler1D tex; +uniform int sz; +uniform int w; + +out vec4 fragment; +in vec4 gl_FragCoord; + +#undef PRE_SMOOTHED_AUDIO +#define PRE_SMOOTHED_AUDIO 0 + +#include ":util/smooth.glsl" + +void main() { + fragment = vec4(smooth_audio(tex, sz, gl_FragCoord.x / w), 0, 0, 0); +} diff --git a/linux-hidpi/glava/wave.glsl b/linux-hidpi/glava/wave.glsl new file mode 100755 index 0000000..6a59fbe --- /dev/null +++ b/linux-hidpi/glava/wave.glsl @@ -0,0 +1,14 @@ +/* min (vertical) line thickness */ +#define MIN_THICKNESS 1 + +/* max (vertical) line thickness */ +#define MAX_THICKNESS 6 + +/* base color to use, distance from center will multiply the RGB components */ +#define BASE_COLOR vec4(0.7, 0.2, 0.45, 1) + +/* amplitude */ +#define AMPLIFY 500 + +/* outline color */ +#define OUTLINE vec4(0.15, 0.15, 0.15, 1) diff --git a/linux-hidpi/glava/wave/1.frag b/linux-hidpi/glava/wave/1.frag new file mode 100644 index 0000000..1352204 --- /dev/null +++ b/linux-hidpi/glava/wave/1.frag @@ -0,0 +1,39 @@ + +layout(pixel_center_integer) in vec4 gl_FragCoord; + +#request uniform "screen" screen +uniform ivec2 screen; /* screen dimensions */ + +#request uniform "audio_l" audio_l +#request transform audio_l "window" +#request transform audio_l "wrange" +uniform sampler1D audio_l; + +out vec4 fragment; + +#include "@wave.glsl" +#include ":wave.glsl" + +#define index(offset) ((texture(audio_l, (gl_FragCoord.x + offset) / screen.x).r - 0.5) * AMPLIFY) + 0.5F + +void main() { + float + os = index(0), + adj0 = index(-1), + adj1 = index(1); + float + s0 = adj0 - os, + s1 = adj1 - os; + float + dmax = max(s0, s1), + dmin = min(s0, s1); + + float s = (os + (screen.y * 0.5F) - 0.5F); /* center to screen coords */ + float diff = gl_FragCoord.y - s; + if (abs(diff) < clamp(abs(s - (screen.y * 0.5)) * 6, MIN_THICKNESS, MAX_THICKNESS) + || (diff <= dmax && diff >= dmin)) { + fragment = BASE_COLOR + (abs((screen.y * 0.5F) - s) * 0.02); + } else { + fragment = vec4(0, 0, 0, 0); + } +} diff --git a/linux-hidpi/glava/wave/2.frag b/linux-hidpi/glava/wave/2.frag new file mode 100644 index 0000000..5ff0706 --- /dev/null +++ b/linux-hidpi/glava/wave/2.frag @@ -0,0 +1,33 @@ + +layout(pixel_center_integer) in vec4 gl_FragCoord; + +#request uniform "prev" tex +uniform sampler2D tex; /* screen texture */ +#request uniform "screen" screen +uniform ivec2 screen; /* screen dimensions */ + +out vec4 fragment; /* output */ + +#include "@wave.glsl" +#include ":wave.glsl" + +void main() { + fragment = texelFetch(tex, ivec2(gl_FragCoord.x, gl_FragCoord.y), 0); + + vec4 + a0 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + a1 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 1)), 0), + a2 = texelFetch(tex, ivec2((gl_FragCoord.x + 0), (gl_FragCoord.y + 1)), 0), + a3 = texelFetch(tex, ivec2((gl_FragCoord.x + 1), (gl_FragCoord.y + 0)), 0), + + a4 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0), + a5 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 1)), 0), + a6 = texelFetch(tex, ivec2((gl_FragCoord.x - 0), (gl_FragCoord.y - 1)), 0), + a7 = texelFetch(tex, ivec2((gl_FragCoord.x - 1), (gl_FragCoord.y - 0)), 0); + + vec4 avg = (a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7) / 8.0; + if (avg.a > 0){ + if (fragment.a <= 0 || gl_FragCoord.x == 0 || gl_FragCoord.x == screen.x - 1) + fragment = OUTLINE; + } +} diff --git a/linux-hidpi/pam_environment b/linux-hidpi/pam_environment index d28c754..e1ef1ec 100644 --- a/linux-hidpi/pam_environment +++ b/linux-hidpi/pam_environment @@ -3,7 +3,7 @@ QT_IM_MODULE DEFAULT=fcitx XMODIFIERS DEFAULT=\@im=fcitx GTK_THEME DEFAULT=Lumiere -GTK2_RC_FILES DEFAULT=/usr/share/themes/Lumiere/gtk-2.0/gtkrc +GTK2_RC_FILES DEFAULT=/home/vbalien/.themes/Lumiere/gtk-2.0/gtkrc BROWSER DEFAULT=google-chrome-stable BACKLIGHT DEFAULT=gmux_backlight diff --git a/linux-hidpi/picom/picom.conf b/linux-hidpi/picom/picom.conf index 70ec8e6..b64fd2a 100644 --- a/linux-hidpi/picom/picom.conf +++ b/linux-hidpi/picom/picom.conf @@ -36,8 +36,9 @@ shadow-exclude = [ "class_g = 'Cairo-clock'", "class_g = 'slop'", "class_g = 'Polybar'", - "_GTK_FRAME_EXTENTS@:c", - "_PICOM_ROUNDED@:32c = 0" + "class_g = 'conky'", + "class_g = 'GLava'", + "_GTK_FRAME_EXTENTS@:c" ]; # Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) @@ -124,6 +125,8 @@ focus-exclude = [ # opacity-rule = [] opacity-rule = [ "100:class_g = 'Polybar'", + "100:class_g = 'conky'", + "100:class_g = 'GLava'", "100:class_g = 'Rofi'", "100:name = 'Picture in picture'", "100:class_g = 'baka-mplayer'", @@ -186,6 +189,8 @@ blur-background-exclude = [ # prevents picom from blurring the background # when taking selection screenshot with `main` # https://github.com/naelstrof/maim/issues/130 + "class_g = 'conky'", + "class_g = 'GLava'", "class_g = 'slop'", "_GTK_FRAME_EXTENTS@:c", ]; diff --git a/mapping.ts b/mapping.ts index 0597285..6975a81 100644 --- a/mapping.ts +++ b/mapping.ts @@ -37,7 +37,7 @@ const linux: DotOption = { kcm-fcitx5 numix-gtk-theme-git numix-circle-icon-theme-git telegram-desktop nautilus eog smplayer smplayer-skins transgui-qt qt5-styleplugins xdg-user-dirs slim network-manager-applet bc - glava conky` + glava conky jq xdo ttf-roboto` ], link: { ...common.link, @@ -74,7 +74,9 @@ const linuxHiDPI: DotOption = { ".config/dunst": "linux-hidpi/dunst", ".config/picom": "linux-hidpi/picom", ".pam_environment": "linux-hidpi/pam_environment", - ".Xresources": "linux-hidpi/Xresources" + ".Xresources": "linux-hidpi/Xresources", + ".config/glava": "linux-hidpi/glava", + ".conkyrc": "linux-hidpi/conkyrc" } };