Пересобранный и видоизмененный conky для ОСГОС
This commit is contained in:
commit
3a48cf8c86
738 changed files with 217718 additions and 0 deletions
104
data/conky.conf
Normal file
104
data/conky.conf
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
-- Определяем функцию для получения фактора масштабирования окна
|
||||
function get_window_scaling_factor()
|
||||
-- Определяем текущего пользователя
|
||||
local user_handle = io.popen("whoami")
|
||||
local current_user = user_handle:read("*a"):gsub("%s+", "") -- Удаляем пробелы и символы новой строки
|
||||
user_handle:close()
|
||||
|
||||
local scale_factor
|
||||
|
||||
if current_user == "root" then
|
||||
-- Если текущий пользователь root, определяем пользователя, который запустил X-сессию
|
||||
local session_user_handle = io.popen("who | grep '(:0)' | awk '{print $1}'")
|
||||
local session_user = session_user_handle:read("*a"):gsub("%s+", "") -- Удаляем пробелы и символы новой строки
|
||||
session_user_handle:close()
|
||||
|
||||
-- Если не удалось определить пользователя, возвращаем масштаб по умолчанию
|
||||
if not session_user or session_user == "" then return 1 end
|
||||
|
||||
-- Выполняем команду от имени этого пользователя
|
||||
local command = string.format("sudo -u %s xfconf-query -c xsettings -p /Gdk/WindowScalingFactor", session_user)
|
||||
local handle = io.popen(command)
|
||||
scale_factor = tonumber(handle:read("*a"))
|
||||
handle:close()
|
||||
else
|
||||
-- Если текущий пользователь не root, просто получаем масштабирование
|
||||
local handle = io.popen("xfconf-query -c xsettings -p /Gdk/WindowScalingFactor")
|
||||
scale_factor = tonumber(handle:read("*a"))
|
||||
handle:close()
|
||||
end
|
||||
|
||||
return scale_factor or 1
|
||||
end
|
||||
|
||||
-- Получаем текущий фактор масштаба окон
|
||||
local scale_factor = get_window_scaling_factor()
|
||||
|
||||
-- Применяем масштаб к шрифту и элементам интерфейса
|
||||
conky.config = {
|
||||
update_interval = 1,
|
||||
cpu_avg_samples = 2,
|
||||
net_avg_samples = 2,
|
||||
out_to_console = false,
|
||||
override_utf8_locale = true,
|
||||
double_buffer = true,
|
||||
no_buffers = true,
|
||||
text_buffer_size = 32768,
|
||||
imlib_cache_size = 0,
|
||||
own_window = true,
|
||||
own_window_type = 'desktop',
|
||||
own_window_argb_value = 200,
|
||||
own_window_argb_visual = true,
|
||||
own_window_transparent = false,
|
||||
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', -- Новая строка для предотвращения скрытия
|
||||
border_inner_margin = 15 * scale_factor,
|
||||
border_outer_margin = 0 * scale_factor,
|
||||
xinerama_head = 1,
|
||||
alignment = 'bottom_right',
|
||||
gap_x = 80 * scale_factor,
|
||||
gap_y = 80 * scale_factor,
|
||||
draw_shades = false,
|
||||
draw_outline = false,
|
||||
draw_borders = false,
|
||||
draw_graph_borders = false,
|
||||
use_xft = true,
|
||||
font = string.format('Comfortaa:size=%d', 12 * scale_factor),
|
||||
xftalpha = 0.8,
|
||||
uppercase = false,
|
||||
default_color = 'white',
|
||||
own_window_colour = '003333',
|
||||
minimum_width = 300 * scale_factor, minimum_height = 0,
|
||||
alignment = 'top_right',
|
||||
color1 = '000000',
|
||||
stippled_border = 100 * scale_factor,
|
||||
};
|
||||
|
||||
-- Variables: https://conky.cc/variables
|
||||
conky.text = string.format([[
|
||||
|
||||
${voffset -10}
|
||||
${font Comfortaa:bold:size=%d}Система ${hr 2}
|
||||
${font Comfortaa:normal:size=%d}Пользователь:${alignr}${USER}
|
||||
Система:${alignr}${font Comfortaa:normal:size=%d}$sysname $kernel
|
||||
Хост:$alignr$nodename
|
||||
Время работы:$alignr$uptime
|
||||
Процессы: $alignr ${execi 1000 ps aux | wc -l}
|
||||
|
||||
${font Comfortaa:bold:size=%d}Процессор ${hr 2}
|
||||
${font Comfortaa:normal:size=%d}${execi 1000 grep model /proc/cpuinfo | cut -d : -f2 | tail -1 | sed 's/\\s//'}${voffset 5}
|
||||
Нагрузка: ${cpu cpu1}%% ${cpubar cpu1}${voffset 5}
|
||||
Температура: ${acpitemp}°С
|
||||
|
||||
${font Comfortaa:bold:size=%d}Память ${hr 2}
|
||||
${font Comfortaa:normal:size=%d}Оперативная память $alignc $mem / $memmax $alignr $memperc%%${voffset 5}
|
||||
Файлы подкачки $alignc ${swap} / ${swapmax} $alignr ${swapperc}%%
|
||||
|
||||
${font Comfortaa:bold:size=%d}Диск ${hr 2}
|
||||
${font Comfortaa:normal:size=%d}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%%
|
||||
${fs_bar /}
|
||||
|
||||
${font Ubuntu:bold:size=%d}Сеть ${hr 2}
|
||||
${font Comfortaa:normal:size=%d}Локальный IP:${alignr}Внешний IP:
|
||||
${execi 1000 ip a | grep inet | grep -vw lo | grep -v inet6 | cut -d \\/ -f1 | sed 's/[^0-9\\.]*//g'} ${alignr}${execi 1000 wget -q -O- http://ipecho.net/plain; echo}
|
||||
${font Comfortaa:normal:size=%d}Down: ${downspeed enp0s3} ${alignr}Up: ${upspeed enp0s3}
|
||||
]], 10 * scale_factor, 8 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor, 8 * scale_factor, 10 * scale_factor)
|
||||
Loading…
Add table
Add a link
Reference in a new issue