Page 1 of 1

Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 7:05 am
by cecca
Hi! Just installed MX Linux with XFCE as DM. Tried to make the modification indicate in this thread but there's no "%l" in the config file and so I can't change the time format to 24 hours.
Can you help me? Thanks in advance

Re: Default Conky 12/24 hour

Posted: Mon Sep 30, 2024 7:32 am
by Eadwine Rose
Please open a new topic next time. Do not dig up dead topics, thanks.


@cecca Your topic is here.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 7:47 am
by j2mcgreg
We need your computer’s complete profile before we can proceed, so you need to post the output from the QSI utility. The Quick System Info (QSI) utility is located in MX Tools and its output is automatically formatted for use here in the forum. Run the QSI utility, click “Copy for Forum” at the bottom and then just paste it here in your thread.
Forum Rules

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 11:38 am
by cecca
Sorry for my mistake.
Quick system info output:

Code: Select all

System:
  Kernel: 6.1.0-25-amd64 [6.1.106-3] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-25-amd64 root=UUID=<filter> ro quiet splash
    resume=UUID=<filter> resume_offset=776192
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23.4_x64 Libretto September 15  2024 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Laptop System: Apple product: MacBookPro5,5 v: 1.0 serial: <superuser required> Chassis:
    type: 10 v: Mac-F2268AC8 serial: <superuser required>
  Mobo: Apple model: Mac-F2268AC8 serial: <superuser required> UEFI: Apple
    v: MBP55.88Z.00AC.B03.0906151708 date: 06/15/09
Battery:
  ID-1: BAT0 charge: 22.5 Wh (33.5%) condition: 67.1/65.4 Wh (102.5%) volts: 11.2 min: 10.9
    model: SMP bq20z451 type: Li-ion serial: N/A status: charging cycles: 18
CPU:
  Info: model: Intel Core2 Duo P8700 bits: 64 type: MCP arch: Penryn level: v1 built: 2008
    process: Intel 45nm family: 6 model-id: 0x17 (23) stepping: 0xA (10) microcode: 0xA0B
  Topology: cpus: 1x cores: 2 smt: <unsupported> cache: L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB
    L2: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 2302 high: 2386 min/max: 798/2527 scaling: driver: acpi-cpufreq
    governor: ondemand cores: 1: 2218 2: 2386 bogomips: 10082
  Flags: ht lm nx pae sse sse2 sse3 sse4_1 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not
    affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA C79 [GeForce 9400M] vendor: Apple driver: nouveau v: kernel non-free:
    series: 340.xx status: legacy (EOL) last: release: 340.108 kernel: 5.4 xorg: 1.20 arch: Tesla
    process: 40-80nm built: 2006-13 ports: active: LVDS-1 empty: DP-1 bus-ID: 02:00.0
    chip-ID: 10de:0863 class-ID: 0300 temp: 60.0 C
  Device-2: Apple Built-in iSight type: USB driver: uvcvideo bus-ID: 1-4:3 chip-ID: 05ac:8507
    class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: nouveau gpu: nouveau display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1280x800 s-dpi: 96 s-size: 338x211mm (13.31x8.31") s-diag: 398mm (15.69")
  Monitor-1: LVDS-1 model: Apple 0x9cc2 serial: <filter> built: 2009 res: 1280x800 hz: 60
    dpi: 114 gamma: 1.2 size: 286x179mm (11.26x7.05") diag: 337mm (13.3") ratio: 16:10 modes:
    max: 1280x800 min: 640x350
  API: OpenGL v: 3.3 Mesa 22.3.6 renderer: NVAC direct-render: Yes
Audio:
  Device-1: NVIDIA MCP79 High Definition Audio driver: snd_hda_intel v: kernel bus-ID: 00:08.0
    chip-ID: 10de:0ac0 class-ID: 0403
  API: ALSA v: k6.1.0-25-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: NVIDIA MCP79 Ethernet driver: forcedeth v: kernel port: 21e0 bus-ID: 00:0a.0
    chip-ID: 10de:0ab0 class-ID: 0200
  IF: eth0 state: down mac: <filter>
  Device-2: Broadcom BCM4322 802.11a/b/g/n Wireless LAN vendor: Apple AirPort Extreme driver: wl
    v: kernel modules: ssb pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 14e4:432b
    class-ID: 0280
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Apple Bluetooth Host Controller type: USB driver: btusb v: 0.8 bus-ID: 4-1.1:3
    chip-ID: 05ac:8213 class-ID: fe01 serial: <filter>
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 1.2 lmp-v: 2.1
    sub-v: 21d0 hci-v: 2.1 rev: 20a
  Info: acl-mtu: 1021:5 sco-mtu: 64:1 link-policy: rswitch hold sniff park
    link-mode: peripheral accept service-classes: rendering, capturing, object transfer, audio,
    telephony
Drives:
  Local Storage: total: 232.89 GiB used: 20.54 GiB (8.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Fujitsu model: MJA2250BH FFS G1 size: 232.89 GiB
    block-size: physical: 512 B logical: 512 B speed: 1.5 Gb/s type: N/A serial: <filter> rev: 0020
    scheme: GPT
Partition:
  ID-1: / raw-size: 232.63 GiB size: 227.92 GiB (97.97%) used: 20.54 GiB (9.0%) fs: ext4
    dev: /dev/sda2 maj-min: 8:2
  ID-2: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 274 KiB (0.1%) fs: vfat
    dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 5.57 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 63.0 C mobo: N/A gpu: nouveau temp: 60.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2138 pm: dpkg pkgs: 2126 libs: 1050 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 12
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://it.mxrepo.com/mx/repo/ bookworm main non-free
Info:
  Processes: 228 Uptime: 3m wakeups: 3 Memory: 3.57 GiB used: 2.11 GiB (59.0%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
Thanks a lot for any help

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 11:47 am
by siamhie
Which conky are you using?

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 11:52 am
by fehlix
cecca wrote: Mon Sep 30, 2024 7:05 am Hi! Just installed MX Linux with XFCE as DM. Tried to make the modification indicate in this thread but there's no "%l" in the config file and so I can't change the time format to 24 hours.
Can you help me? Thanks in advance
The easiest might be this:
Change LANG to en_IE.UTF-8, or at least LC_TIME to en_IE.UTF-8,
to get English-Ireland locale with 24H.
Do logout and login. You may need select LANG in upper right corner at the login window, if you changed LANG and not only LC_TIME
The reason: Most (nearly all) MX Conky's do display 12/24 H based on locale settings (LANG or LC_TIME)-
To adjust LANG and/or LC_TIME easiest use the tool mx-locale, to be found within the menu or in "MX Tools"
Good luck.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 12:44 pm
by T3KN05H4M4N
I got this from the antiX Linux website. I use antiX on one of my older laptops and I couldn't figure out how to change it from 24 hour to 12 hour. In your case, it's the opposite. It's called, Casey's Conky Reference Manual. You'll want to click on the "Time Format String Variables" section and it will show you how to adjust the settings to change it to 24 hour. Hope this helps. Here's the link:

http://www.ifxgroup.net/conky.htm

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 1:36 pm
by fehlix
T3KN05H4M4N wrote: Mon Sep 30, 2024 12:44 pm I got this from the antiX Linux website. I use antiX on one of my older laptops and I couldn't figure out how to change it from 24 hour to 12 hour. In your case, it's the opposite. It's called, Casey's Conky Reference Manual. You'll want to click on the "Time Format String Variables" section and it will show you how to adjust the settings to change it to 24 hour. Hope this helps. Here's the link:

http://www.ifxgroup.net/conky.htm
MX Conky's are using lua and some other tricks, to get 12H/24H displayed based on locale settings.
So your advice is reasonable, but simplest to adjust MX provided Conky's by adjusting locale settings, so no need to learn conky language.
in order to change to 24H.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 2:03 pm
by DukeComposed
cecca wrote: Mon Sep 30, 2024 7:05 am there's no "%l" in the config file and so I can't change the time format to 24 hours.
Can you help me? Thanks in advance
"man conky" defers formatting to strftime:

Code: Select all

       time (format)
              Local time, see “man strftime” to get more information about format.
"man strftime" outlines several valid formatting options for displaying hours, including these:

Code: Select all

       %H     The  hour  as a decimal number using a 24-hour clock (range 00 to 23).  (Calculated
              from tm_hour.)

       %I     The hour as a decimal number using a 12-hour clock (range 01 to  12).   (Calculated
              from tm_hour.)

       %r     The  time  in a.m. or p.m. notation.  (SU) (The specific format used in the current
              locale can be obtained by calling nl_langinfo(3) with T_FMT_AMPM as  an  argument.)
              (In the POSIX locale this is equivalent to %I:%M:%S %p.)

       %R     The  time  in  24-hour notation (%H:%M).  (SU) For a version including the seconds,
              see %T below.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 2:13 pm
by fehlix
DukeComposed wrote: Mon Sep 30, 2024 2:03 pm
cecca wrote: Mon Sep 30, 2024 7:05 am there's no "%l" in the config file and so I can't change the time format to 24 hours.
Can you help me? Thanks in advance
"man conky" defers formatting to strftime:
Without %I within the conky's strftime won't help much
You may find some lua code like this:
${lua hours}
So you may consider to learn lua, if you prefer so, instead of adjust 24H locale settings.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 2:59 pm
by DukeComposed
fehlix wrote: Mon Sep 30, 2024 2:13 pm Without %I within the conky's strftime won't help much
I don't think it's a problem of conky not having "%I", I think OP is asking how to show 24-hour time when "grep '%I' ~/.conky/something" is empty. The solution is to read "man conky", determine what the value is that is being changed, and change it if possible. The assumption is that this value is the time, but it could just as easily be some kind of mtime timestamp or hard-coded string thus. conky supports strftime, even if the as yet unspecified config file doesn't presently contain any strftime formatting options.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 3:38 pm
by cecca
Thanks to all for the help. I'll try first changing locale since I don't have so much time to learn Conky language or lua. But I'll keep this post in mind for learning something new as soon as I'll have time

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 7:52 pm
by atomick
what actual conky mod are you running?? (See was already asked of you? do not see a response to help more) But... to want to change to '24 hr' little hacking the %R will reap your reward to change. There is one in the MX conky selection that exhibits 24hr clock. MX-FluxKeys/FluxKeys.conf. I used that and man strftime which lead to actual date playing options %R was the trik.

I modified lots a fully custom KoO/MX-Full mod, for amd7800x3D and also all same for amd7950x3D chip set and just found fair easy to simply modify or delete the %l:%M %P to simply %R saved it and it printed now 24hr in my clock display line.
Mite post it if any wish for -ahs- users and 8/16 cpu configurations. conky mod. I've my mx7800 now modified for 24hr was planning on such fix. By this poke now I'm updated hope my code helps. wrks aces for moi.

Before:
${time %d %B %Y %l:%M %P}${endif}$font$color
After:
${time %d %B %Y}$alignr$color2${font Open Sans:Bold}${time %R}${endif}$font$color

my 24hr representation is tad more large now with this code, kina not too hard to modify and switch few things around w/o having to learn the code - simply play around review some other "How'd they do that" And cut.n.add snip.n.clip, pretty easy w/o having to show your all hardware qsi jazz.??
might have to check top to match the "colorX" for to use rightly. my color2 is more yellow than orange. and or add colors to your conky to provide some other play changes.

usually modified in FeatherPad when you click on the conky-manager and then left column selector click your Mod - top of the manager center is a pen click that to open F/Pad to modify when you click save the conky on your desktop will flash the updates immediately so playful attempts are easily seen good bad okay right or Wrong. Still even in edit mode, Simply try and keep exact to syntax and shud be good to go. After play just close out and your good.
Ask and yeah shall Rx. Cheers.

PS: if your stuck pls simply let us know what conky in MX your running and we can adapt to share a change to help more. Cheers. :p

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 8:09 pm
by Crampingwarbear
I was never able to get the default Conky in MX 23 to show time in 24 hr no matter what settings I changed. I changed the LUA to the following:

Code: Select all

-- some globals
   CJK = 'false'
   DATE_FORMAT = '${time %A   %B %d}'
   LANG = os.getenv("LC_ALL")
   if ( not LANG or LANG == '' ) then  LANG = os.getenv("LANG") end
   if ( not LANG or LANG == '' ) then  LANG = "C" end
   if string.match(LANG,"^%l%l+_%u+") then
      LL_CC = string.sub(LANG, string.find(LANG, "^%l%l+_%u+"))
   else
      LL_CC = "C"
   end
   if  string.match(LANG,"^%l%l+") then
       LL = string.sub(LANG, string.find(LANG, "^%l%l+"))
   else
       LL = "C"
   end

-- some locals
local date_format_table =
{
   ['en_US']   = '${time %A   %B %d}',
   ['en']      = '${time %A   %B %d}',
   ['C']       = '${time %A   %B %d}',
   ['de_DE']   = '${time %A  %-d. %B}',
   ['de']      = '${time %A  %-d. %B}',
   ['ja']      = '${time %B %d日 %A}',
   ['ko']      = '${time %B %d일 %A}',
   ['zh']      = '${time %B %d日 %A}',
   ['default'] = '${time %A  %d %B}',
}

local cjk_table =
{
   ['ja'] = 'true',
   ['ko'] = 'true',
   ['zh'] = 'true',
   ['ar'] = 'true',
   ['fa'] = 'true',
   ['he'] = 'true',
}

-- some functions
function has_ampm()
    local handle = io.popen("locale  -k d_t_fmt | grep  -sqo -E '%r|%p|%I' && echo yes || echo no")
    local output = handle:read("*l")
    handle:close()
    return  output
end


function conky_hours()
    if ampm then
        return os.date("%H")
    else
        return os.date("%H")
    end
end

function conky_lang()
     return os.getenv("LANG")
end

function conky_cpu()
     local str=''
     str=conky_parse('${cpu cpu0}')
     return string.format("%3d", str)
end

function conky_memperc()
     local str=''
     str=conky_parse('${memperc}')
     return string.format("%2d", str)
end

-- CJK handling

function conky_cjk()
    if cjk_table[LL] then
       return 'true'
    else
       return 'false'
    end
end

function conky_time(a)
     local s='${time %' .. a .. '}'
     return conky_parse(s)
end

function conky_set_time(d)
     if ( d == 'a' or d == 'A' ) then
        TIME_A = d
     elseif ( d == 'b' or d == 'B' ) then 
        TIME_B = d
     end
     set_date_format()
     return ''
end

function date_format()
     local date_format
     if      date_format_table[LL_CC] then
             date_format = date_format_table[LL_CC]
     elseif  date_format_table[LL] then
             date_format = date_format_table[LL]
     else
        date_format = date_format_table['default']
     end
        if TIME_A == 'a' then date_format = date_format:gsub('A', 'a');  end
        if TIME_B == 'b' then date_format = date_format:gsub('B', 'b');  end
     return date_format
end

function set_date_format()
     DATE_FORMAT = date_format()
     return
end

function conky_date_format() return DATE_FORMAT; end
function conky_get_date_format() return DATE_FORMAT; end

function conky_date()
     local format_str = DATE_FORMAT
     str=conky_parse(format_str)
     return str
end

I can't remember exactly what I deleted but now I have the default MX Conky showing time in 24hrs with no am/pm visible.

Hope that helps.

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 9:39 pm
by atomick
odd I simply just went thru all my "conky" mods top down some already display 24hr. The Rest I simply changed "%I - to %H " and many took on the Hour seeing %M was just after in line of code. {that covers both Hour Minute displayed}.
So I'm going Zip my .conky folder and retain a 24hr settings. Some are little finicky to set with as example 1st shown in my code change. I did also end up deleting some of the additional all similar like and replaced with %R. its the the case closed on most only a few. There is a Time Template Format I did not mess with that. Simply with in the lines of code where it showed the $I or both %k:%M removed and replaced with %R all worked for me easy enough. Thought to pop back and inform. Maybe take a step back and take another approach little different. Good suggestion is to create an all new say "Test" users account. It will also get a fresh .conky/mods all from /etc/skel fresh copy, so that you can log off on and sign in with Test account and play without messing up. So there too is as recovery
you can also copy /etc/skel/.conky to your own home folder and recover as if 1st signed in.
Best perform this trick as Root or sudo shud wrk.

su - root and enter roots passwd
cd /etc/skel
cp -r .conky /home/test OR /home/myAccountname
exit - bk as your own user

in basics should be okay but logoff/on again an play around with checking each conky mod out and try the %I change too %H and wait a flash of the display mod and see the hour change from 12 to a 24 hr. My System Clock in the tool bar is already set by features of its clock options to "24 hr" So conky in belief works from/by system set time. if your locale is set should still be good to play around and get results.

the once again Miss your forgetting is to share what actual conky think you mentioned its basic default - try another like
~/.conky/MX-Simple/conkyrc , this is pretty easy. Simply uncheck what your trying cursor down to MX-Simple/conkyrc Select then with ConkyMgr edit cursor down where 'conky.text = [[ 4th line down see the ${else}${time %I} change this "I" to show %H save and wait - this also has a second wheel so it takes a few catch up seconds to re-Display and show your change.
Okay Sorry I missed that recheck the Default is an MX-Cowon wow there are like 8 of them in various those I forfeit to change
but here if you wish to change Edit cursor down too "conky.text = [[ see the ${voffset -176} next is ${lua hours} this is a fubar
sleight of hand. Change this too ${time %H} only and save and see the chg. BaddaBingBooom. 24hr or the hour shows what you desire. *nix has so many ways to do things all are correct when the results show right! Cheers.

PS: Again another trick when in Edit mode since default edit is FeatherPad copy out those few lines of code and at top left icon open a fresh sheet and paste in that original code. Now you can test jump back forth and see orig an your change code make an error copy back write it and try again. Hope that zings up a smile. last tip with Thunar can select open with root copy the /etc/skel/.conky and re-paste back into /home/you folder an try more.

Re: Conky can't change to 24 hour  [Solved]

Posted: Mon Sep 30, 2024 9:48 pm
by Stuart_M
The original poster never stated what Conky is being used that is to be converted to display 24-hour time. Without knowing that I will presume it is the default Conky for MX-23. This is how I converted that Conky in a Live MX-23.4 (Xfce) to display 24-hour time. If another Conky is being used then please advise the name.

The default Conky for MX-23 is "MX-Cowon_MildBlue" so that is what I used. If you want an easier solution then just copy the entire Conky code for that Conky, which is the result of the edits I made as shown below. That is in the last code window below, and paste it into a new file in the directory that contains the original (default) Conky. I suggest you name it anything other than the default name so you can easily identify it in the Conky Manager.

Edit the Conky file, starting at the line below the beginning of the Conky text, like this:

1. After the first line of the Conky text conky.text = [[, delete the four lines below it. Those four lines to delete are:
  • ${if_match "${lua time A}" == "${time %A}"}${lua set_time A}\
  • ${else}${lua set_time a}${endif}\
  • ${if_match "${lua time B}" == "${time %B}"}${lua set_time B}\
  • ${else}${lua set_time b}${endif}\
2. Now delete the line ${lua hours} and put ${time %H} in its place. Note that the "H" in strftime code means "The hour as a decimal number using a 24-hour clock". In other words, this will produce a 00-24 hour display, based on the system time.

To summarize Steps 1-2 above, the first four lines of the Conky text should now look like this:

Code: Select all

conky.text = [[
${voffset -176}
${time %H}
${color2}${offset 36}${voffset -95}${time %M}
3. Now that the Conky is displaying 24-hour time, the AM/PM text should be removed since it is not needed. To do that:
  • Remove the AM/PM text to the right of the time. To do that simply comment out the line ${color2}${lua AM_PM} (this is done by putting the number symbol (#) at the start of the line so it looks like # ${color2}${lua AM_PM} (or you can just delete that line, but then remember to adjust the below two line numbers by -1).
  • On Line 97 change the "offset" value from 150 to 0.
    This moves the hour and minute numbers to the right to make up for the removal of the "AM/PM" text.
  • On Line 105: change the "voffset" value from 160 to 180.
    This moves the "hdd" line below the date line.
Note that those are the line numbers AFTER Steps 1-2 have been done.

The completed text of the "MX-Cowon_MildBlue" Conky file (Steps 1-3 above) is in the below code window. Copy that into another Conky file and it will appear as another Conky for use in the Conky Manager.

Code: Select all

conky.config = {
--#####################
-- - Conky settings - #
--#####################
	update_interval = 1,
	total_run_times = 0,
	net_avg_samples = 1,
	cpu_avg_samples = 1,

	imlib_cache_size = 0,
	double_buffer = true,
	no_buffers = true,

--####################
-- - Text settings - #
--####################
	use_xft = true,
    font = 'Roboto-Light:size=100',
	override_utf8_locale = true,
	text_buffer_size = 2048,
	xftalpha = 0.9,

--############################
-- - Window specifications - #
--############################
	own_window_class = 'Conky',
	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = true,

	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
--own_window_argb_visual yes
--own_window_argb_value 100

	alignment = 'top_right',
	gap_x = 40,
	gap_y = 40,
	minimum_width = 200, minimum_height = 220,

	
--########################
-- - Templates - 		#
--########################

template1 = '${color4}${font RobotoMono-Light:bold:pixelsize=12}${offset 8}',
template2 = '${offset 4} ${color4}batt${offset 6}',

	
--########################
-- - Graphics settings - #
--########################
	draw_shades = false,

	--hour
	default_color = 'aabbcc',
	default_shade_color = '1d1d1d',
	color0 = 'ffffff',
	--date
	color1 = 'aabbcc',
	--min
	color2 = '77ddff',
	--text
	color3 = '77ddff',
	--percentages
	color4 = 'aabbcc',

--lua_load ~/.conky/conkybg.lua
--lua_draw_hook_pre conky_draw_bg

	own_window_argb_value = 0,
	own_window_argb_visual = true,
	own_window_colour = '000000',
	lua_load = 'lua/conky.lua',

};

-- fluxbox adjustment
-- if os.getenv("XDG_SESSION_DESKTOP") == 'fluxbox' then
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 = [[
${voffset -176}
${time %H}
${color2}${offset 36}${voffset -95}${time %M}
${voffset -130}${offset 10}\
${if_match "${lua cjk}" == "false"}\
${font Roboto-Light:bold:size=12}\
${else}\
${font wqy-microhei:bold:size=12}\
${endif}\
${color1}${lua date}
${offset 0}${voffset -175}\
${if_match "${lua cjk}" == "false"}\
${font Roboto-Light:size=12}\
${else}\
${font wqy-microhei:size=12}\
${endif}\
# ${color2}${lua AM_PM}
#system
${offset 0}${voffset 180}\
${font Roboto-Light:bold:pixelsize=14}${offset 12}${color3}hdd \
${offset 2}${color4}\
${font RobotoMono-Light:bold:pixelsize=12}${fs_used_perc /}%\
${font Roboto-Light:bold:pixelsize=14}\
${offset 4}${color3} mem \
${offset 2}${color4}\
${font RobotoMono-Light:bold:pixelsize=12}${lua memperc}%\
${font Roboto-Light:bold:pixelsize=14}\
${offset 2}${offset 4}${color3}cpu\
${color4}${font RobotoMono-Light:bold:pixelsize=12}${lua cpu}%\
#battery
${offset 0}${voffset 10}\
${if_existing /sys/class/power_supply/BAT0/present/ 1}${template1}
${template2}${battery_bar 8,80 BAT0} ${battery_percent BAT0}% ${endif}\
${if_existing /sys/class/power_supply/BAT0}${template1}
${template2}${battery_bar 8,80 BAT0} ${battery_percent BAT0}% ${endif}\
${if_existing /sys/class/power_supply/BAT1}${template1}
${template2}${battery_bar 8,80 BAT1} ${battery_percent BAT1}% ${endif}
${voffset -190}
]];
The below screenshot is the result of the above, showing how the "MX-Cowon_MildBlue" Conky looks displaying 24-hour time, showing 21:00 (9:00 PM):
MX-Cowon_MildBlue_Conky_24-hr_Modification.png

Re: Conky can't change to 24 hour

Posted: Mon Sep 30, 2024 10:03 pm
by atomick
Stuart your excellent beat me to the edit finish. it all was so simple ${lua hour} change too ${time %H} and its done. Cheers.

Re: Conky can't change to 24 hour

Posted: Tue Oct 01, 2024 9:35 am
by cecca
Thanks a lot Stuart. I'll try what you've explained so well