Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1st file: LUA file
- ---------------------
- function filetonumber(path)
- local f = io.open(path)
- local nr = f:read()
- f:close()
- return nr
- end
- function conky_batcapnow()
- local capbat0 = filetonumber("/sys/class/power_supply/BAT0/energy_now")
- local capbat1 = filetonumber("/sys/class/power_supply/BAT1/energy_now")
- local capbat = (capbat0 + capbat1)/1000000
- return capbat
- end
- function conky_batcapfull()
- local capbat0 = filetonumber("/sys/class/power_supply/BAT0/energy_full")
- local capbat1 = filetonumber("/sys/class/power_supply/BAT1/energy_full")
- local capbat = (capbat0 + capbat1)/1000000
- return capbat
- end
- function conky_batcapfulldesign()
- local capbat0 = filetonumber("/sys/class/power_supply/BAT0/energy_full_design")
- local capbat1 = filetonumber("/sys/class/power_supply/BAT1/energy_full_design")
- local capbat = (capbat0 + capbat1)/1000000
- return capbat
- end
- function conky_batpowernow()
- local pwrbat0 = filetonumber("/sys/class/power_supply/BAT0/power_now")
- local pwrbat1 = filetonumber("/sys/class/power_supply/BAT1/power_now")
- local pwrbat = (pwrbat0 + pwrbat1) / 1000000
- return pwrbat
- end
- function conky_batremainingtime()
- local remhrs = (conky_batcapnow() / (conky_batpowernow()+1))
- local hours = math.floor(remhrs)
- remhrs = remhrs - hours
- local minutes = math.floor(remhrs*60)
- remhrs = remhrs - (minutes/60)
- local seconds = math.floor(remhrs*60)
- return conky_parse(hours .. "h " .. minutes .. "min")
- end
- function conky_batpercentage()
- local percent = (conky_batcapnow() / conky_batcapfull())*1000
- return math.floor(percent)/10
- end
- function conky_batteryBO_bar(maxbarlen)
- local e_full_bat0 = filetonumber("/sys/class/power_supply/BAT0/energy_full")
- local e_full_bat1 = filetonumber("/sys/class/power_supply/BAT1/energy_full")
- local len0 = math.floor(maxbarlen * (e_full_bat0/(e_full_bat0+e_full_bat1)))
- local len1 = math.floor(maxbarlen - len0)
- return conky_parse("${battery_bar 15, " .. len0 .. " BAT0} ${battery_bar 15, " .. len1 .. " BAT0}")
- end
- 2nd file:
- CONKY FILE:
- conky.config = {
- ---- Informant Conky
- ---- Date : 2023/17/03
- ---- Editor : unimetal
- ---- Version : v6.6.6
- ---- By unimetal
- --# Add Lua Functions #####################
- lua_load = '~/.conky/MX-Simon/calculations.lua',
- --# Begin Window Settings #####################
- own_window = true,
- own_window_type = 'normal',
- ----original own_window_type is desktop
- own_window_hints = 'undecorated,above,sticky,skip_pager',
- own_window_transparent = false,
- --# ARGB can be used for real transparency
- --# NOTE that a composite manager is required for real transparency.
- --# This option will not work as desired (in most cases) in conjunction with
- --# own_window_type normal
- own_window_argb_visual = true,
- --# When ARGB visuals are enabled, use this to modify the alpha value
- --# Use: own_window_type normal
- --# Use: own_window_transparent no
- --# Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
- own_window_argb_value = 150,
- own_window_colour = '000000',
- minimum_width = '250',
- minimum_height = '200',
- maximum_width = 250,
- gap_x = 10,
- gap_y = 0,
- alignment = 'middle_right',
- --# End Window Settings ###
- --# Font Settings ######################
- ---- Use Xft (anti-aliased font and stuff)
- use_xft = true,
- -- Requires mono font for spacing reasons
- -- xftfont Liberation Mono:bold:size=30
- font = 'Roboto-Light:size=30',
- -- Alpha of Xft font. Must be a value at or between 1 and 0 ###
- xftalpha = 1,
- ---- Force UTF8? requires XFT ###
- override_utf8_locale = true,
- uppercase = false,
- --# End Font Settings ###
- --# Colour Settings ###
- draw_shades = false,--#yes
- default_shade_color = 'black',
- draw_outline = false,--# amplifies text if yes
- default_outline_color = 'black',
- --# Color scheme ##
- --# fe4515 crimson-orange
- default_color = '#ff0000',
- --# ffffff white
- color1 = 'ffffff',
- --#######################
- --# End Colour Settings ###
- --# Borders Section ##
- draw_borders = false,
- ---- Stippled borders?
- stippled_borders = 5,
- ---- border margins
- border_inner_margin = 5,
- border_outer_margin = 0,
- ---- border width
- border_width = 2,
- ---- graph borders
- draw_graph_borders = true,--#no
- ----default_graph_size 15 40
- --# End Borders Secton ###
- --# Miscellaneous Section ##
- ---- Boolean value, if true, Conky will be forked to background when started.
- background = true,
- ---- Adds spaces around certain objects to stop them from moving other things
- ---- around, this only helps if you are using a mono font
- ---- Options: right, left or none
- use_spacer = 'none',
- ---- Default and Minimum size is 256 - needs more for single commands that
- ---- "call" a lot of text IE: bash scripts
- ----text_buffer_size 6144
- ---- Subtract (file system) buffers from used memory?
- no_buffers = true,
- ---- change GiB to G and MiB to M
- short_units = true,
- ---- Like it says, ot pads the decimals on % values
- ---- doesn't seem to work since v1.7.1
- pad_percents = 2,
- ---- Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
- ---- $image lots. Set to 0 to disable the image cache.
- imlib_cache_size = 0,
- ---- Use the Xdbe extension? (eliminates flicker)
- ---- It is highly recommended to use own window with this one
- ---- so double buffer won't be so big.
- double_buffer = true,
- ---- Maximum size of user text buffer, i.e. layout below TEXT line in config file
- ---- (default is 16384 bytes)
- ---- max_user_text 16384
- ---- Desired output unit of all objects displaying a temperature. Parameters are
- ---- either "fahrenheit" or "celsius". The default unit is degree Celsius.
- ---- temperature_unit Fahrenheit
- --# End Miscellaneous Section ###
- update_interval = 1,
- minimum_width = 0, minimum_height = 0,
- -- time template
- template0 = '%H',
- };
- -- fluxbox adjustment
- return_code = os.execute('pidof -q fluxbox')
- if _VERSION == 'Lua 5.1' and math.floor(return_code/256) == 0 or
- _VERSION ~= 'Lua 5.1' and return_code then
- conky.config.own_window_transparent = true
- conky.config.own_window_argb_visual = false
- end
- conky.text = [[
- ${font Roboto-Light:Light:size=65}${alignc}${if_match "pmfix${time %p}" == "pmfix"}${time $template0}${else}${time %I}${endif}${color1}:${time %M}${font}${color}
- ${font Roboto-Light:Light:size=24}${voffset 12}${alignr}${color1}${time %A},${color} ${time %d}${color0} ${time %B}${font}${voffset 2}
- ${color}${font Roboto-Light:Light:size=15}${color}${font size=8}internal${alignr}external
- ${color1}${exec awk '{print $0/1000000}' /sys/class/power_supply/BAT0/energy_now} Wh ${alignr}${color1}${exec awk '{print $0/1000000}' /sys/class/power_supply/BAT1/energy_now} Wh
- ${color green}${lua conky_batteryBO_bar 245}
- ${font Roboto-Light:Light:size=15}${color}Remaining: ${alignr}${color1}${lua conky_batremainingtime}
- ${font Roboto-Light:Light:size=15}${color}Percentage:${alignr}${color1}${lua conky_batpercentage}%
- ${color}${font DejaVu Sans Mono:pixelsize=15}CPU ${color1}${hwmon temp 1}°C${color} CPU load:
- ${color}${font DejaVu Sans Mono:pixelsize=15}1/4${alignr}${color1}${cpubar cpu0 16,150}
- ${color}${font DejaVu Sans Mono:pixelsize=15}2/4${alignr}${color1}${cpubar cpu1 16,150}
- ${color}${font DejaVu Sans Mono:pixelsize=15}3/4${alignr}${color1}${cpubar cpu2 16,150}
- ${color}${font DejaVu Sans Mono:pixelsize=15}4/4${alignr}${color1}${cpubar cpu3 16,150}
- ${color}${font DejaVu Sans Mono:pixelsize=13}RAM Usage :${alignr}${color1}$mem${color} / ${color1}$memmax${color}
- ${membar}
- ${color}${font DejaVu Sans Mono:pixelsize=13}Disk Usage :${alignr}${color1}${fs_used /}${color} / ${color1}${fs_size /}
- ${color}${font DejaVu Sans Mono:pixelsize=13}${color}UpTime:${alignr}${color1}$uptime
- ${color}${font DejaVu Sans Mono:pixelsize=13}${color}Pbat:${alignr}${color1}${lua conky_batpowernow}Watt
- ${color}${font DejaVu Sans Mono:pixelsize=13}${if_existing /proc/net/route wlan0}wlan0: ${alignr}${color green}${addr wlan0}${else}wlan0: ${alignr}${color1}disconnected${endif}
- ${color}${font DejaVu Sans Mono:pixelsize=13}${if_existing /proc/net/route eth0}eth0: ${alignr}${color green}${addr wlan0}${else}eth0: ${alignr}${color1}disconnected${endif}
- ${color}${font DejaVu Sans Mono:pixelsize=13}${totalup}${totaldown}
- ]];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement