Commit Graph

141 Commits

Author SHA1 Message Date
Dan Church 7807ea60da Combine vim ftdetect commands
Causes [very] slightly less memory to be used by Vim.
2023-05-19 11:57:40 -04:00
Brenden Matthews 6730dafb03
feat: Move docs to website, rearrange bits (#1475) 2023-03-28 08:21:17 -04:00
bi4k8 e5413a22d7
config: add out_to_wayland to bool setting list for config converter 2022-12-24 09:42:02 -05:00
Brenden Matthews 97687633a7 Separate docs & extras (syntax files) build.
Rather than piggybacking on the BUILD_DOCS flag, use BUILD_EXTRAS to
enable building the nano & vim syntax files. This is so that people can
generate the extras without having to install pandoc.
2022-10-14 09:44:54 -04:00
Brenden Matthews 670973a678 Update extras (syntax files) w/ new docs.
Generate the list of symbols for vim & nano syntax files using
docs data + jinja2.

Also refactored the doc handling a bit.
2022-10-04 18:18:08 -04:00
Gene Carlson bebf3f2bef Linux: show the scaling governor with $cpugovernor. 2022-09-24 12:05:09 -04:00
Gene Carlson 5467287613 Linux: add a variable free_bufcache for reporting buffers+cache as reported by free. 2022-09-23 09:32:02 -04:00
Gene Carlson be82b6f14d Linux: enable displaying shmem and memavail as variables. 2022-09-23 09:32:02 -04:00
François Revol f678e48900 Add syntax keyword for http_port config setting 2022-09-12 20:53:41 +02:00
freddii d06649ec52 fixed typo 2021-01-30 18:59:21 -06:00
freddii b62e115830 fixed wrong spelled words 2021-01-23 17:59:07 -06:00
Bojan Novkovic 1abae95253 fixed nil value call error while converting old sytax config 2020-08-31 13:50:28 -04:00
Chris Bosse 50c2b2b159 Fix typo
Typo created empty file `1` and threw error:

sh: 1: dos2unix: not found
2020-07-27 08:07:25 -04:00
Brenden Matthews 1c599a2752
Add missing mpd_comment variable. 2020-07-27 08:01:52 -04:00
Monsterovich 3893146995 Added option to disable redraw on desktop change 2019-02-25 17:11:14 -05:00
lasers 9dd559b1e9 remove deprecated BMPx support 2019-01-04 19:58:52 -06:00
Dan McCombs 2a0d2a741a Add draw_blended to convert.lua script so that it is converted to boolean properly from old configuration formats. (#689) 2018-12-03 15:00:46 -05:00
lasers f8ff46c2dc add memwithbuffersgraph variable (#671) 2018-10-21 15:52:15 +03:00
Amish Naidu 9b4fc81553 fontN - Predefine font configuration analgous to colorN (#667)
* Add fontN config and text variables

fontN, N in {0..9} allows setting a fontN variable to some font settings
which can later be recalled in text, like colorN.

* Add documentation for fontN

* Add syntax-highlighting config for fontN
2018-10-12 20:43:48 +03:00
lasers e4e6a4ff60 extras/convert.lua: run dos2unix too if it is available (#604) 2018-08-13 08:20:52 -04:00
lasers cb5833e2fc
extras/convert.lua: change url to wiki page (#554) 2018-08-03 17:28:42 -05:00
Evan da47868d1e Add cat and catp variables. (#507) 2018-05-19 10:27:10 -04:00
npyl b20d83b747 Basic macOS support (#480)
* Initial patches for Darwin support

* cmake files ready for building on Sierra. Dont know about other OSX versions

* Added darwin.h which will contain darwin specific headers

* Patches for enablin asprintf support (needs _POSIX_C_SOURCE >= __DARWIN_C_FULL so remove -D_POSIX_C_SOURCE=200809L).  What is more, -D_LARGEFILE64_SOURCE is used by default so not needed on macOS

* Stubs for get_entropy_avail and get_entropy_poolsize

* More progress to getting to build

* More patches

* Now builds, remains fixing linking errors. Also implemented some functions

* Now links

* Now conky runs without sigabrt()'ing... An exception in semaphore.hh caused it to crash immediately upon initialisation

* README changes

* This was based on an old attempt I did with porting conky where I hadn't cloned the repo and thus it showed 3166 commits behind

* Patched a bit the semaphore.hh and now conky runs at 0.7% CPU usage and not in 100% or 200% as it did before! Yeah

* This update fixes swap-related miscalculations, though:

On macOS there can be used MANY swapfiles ( NOT swap partitions,,, the installation disk is the partition for storing swap memory data )
Thus conky code must be updated for Darwin to support multi-swapfile usage stats.

For now, we default to showing stats for swapfile0

* Fixed a bit the comments so they make sense

* Realised that the sysctl code can give us stats for the whole swap storage so removed the swapmode( int swapfd, unsigned long * retvail, unsigned long * retfree )

* I think the code is in good condition now

* semaphore.hh: Implemented ~semaphore() and added throwing exception
when sem initialisation fails just like in sem() for linux…

darwin.cc:  partially implemented update_cpu_usage() and
update_total_processes()

* Implements update_total_processes()

( Now it finds the correct number of tasks )

the changes in cmake file don’t change the functionality… It is only
comments.

In upcoming updates lua support may be enabled and the comments are
related to lua support.

* get_cpu_count() now conforms to newer sysctl code as suggested by Apple ( we use hw.logicalcpumax instead of hw.ncpus )   -->  The new implementation of get_cpu_count() finds the the max value of logical cores the mac could use on a boot.

update_total_processes() was patched to allow initialising only ONCE when conky runs the machHost and processorSet ( this could probably be implemented in a better way I guess though... )

* patch

* experimental support for get_top_info() and update_cpu_usage() :)

* going to patch stuff

* adds getting rss memory in get_top_info()

* fixes

* Couple things made more beautiful but too many things to fix ...

* Remove unneeded code from darwin_soundcard.h and keep only needed to
compile ( This way we are compatible to GPLv3, i think )

Include GPLv3 header in darwin.cc, darwin.h and darwin_soundcard.h

Add more beautiful and explanatory comments to ease the work of other
contributors… ( Mostly on things that don’t work! )

* Merged the macOS update_cpu_usage() implementation with the linux implementation but still it doesn't work as expected, plus, there are more memory related problems that will be fixed in newer release!

NOTE: It will be really good to see how functions are implemented on linux.cc for more complete implementation

* Now using a more linux-influenced implementation and dropping the old... ( only keeps mach stuff )
Needs some more work though to print accurate percentage! :)

* Add conky installer (.pkg) project

* Now gets thread count aswell! For now, we get this from update_total_processes... Also, removed the installer project because I need to learn more the software

* Properly get thread count!

- Patched core.cc to enable getting threads count on macOS!

- Cleanup in darwin.cc

* sort out some things in the code:

- running_threads_count is not the same as thread_count on macOS! There is actually a difference!
Correct a bit the code!

* Enable the if_mounted command and start implementing the check_mount function in darwin.cc

* Tighten things up

* This patch makes conky build easily and without patching on any supported macOS version!  The new flag introduced is a temporary solution for allowing conky to compile on other OS without tweaking the cmake files.  If you want to compile it with i18l support you will have to run the command: brew link gettext after you install gettext

* Update README to provide more complete info on building on macOS

* Fix

* patch check_mounted + SIP status

This commit:

- patches check_mounted function to match the implementation found in FreeBSD.cc! Now conky expects typing something like this:

conky -t '${if_mounted /Volumes/MacOS} ${endif}'

Please note that the correct way is "/Volumes/MacOS", not "/Volumes/MacOS/" ! You shouldnt put the backslash at the end... It will not work!

- Adds a new command called sip_status which you can use to make conky show System Integrity Protection related information such as if filesystem protection is enabled, if user approved kexts protection is enabled and more...

you can type conky -t '$sip_status' to  see what it does...

( I will most likely update some things later regarding sip_status and check_mounted )

* Further implement sip_status

sip_status now has different functionality!

If you give no arguments it shows whether SIP is enabled or disabled ( generally )
If you give argument ( takes only ONE ) you can specify which specific thing of SIP you want to show status for...

You need to pass 0, 1, ..., 9 to $sip_status as argument to print status for apple-internal, untrusted-kexts, and more...

Below you can see the list:

ARG:                   RESULT:
nothing --> print enabled / disabled
0   --> allow_apple_internal
1   --> allow_untrusted_kexts
2   --> allow_task_for_pid
3   --> allow_unrestricted_fs
4   --> allow_kernel_debugger
5   --> allow_unrestricted_dtrace
6   --> allow_unrestricted_nvram
7   --> allow_device_configuration
8   --> allow_any_recovery_os
9   --> allow_user_approved_kexts

* sip_status progress & if_up enabled

This commit adds the 'a' argument for $sip_status which checks if the SIP configuration is ok or it is likely to break in the future.

Also, enabled the $if_up command, but there are some problems with it...

* sip_status patches

- Updated code based on newest version of csrstat utility (v.1.8)
The 1.8 version fixes a problem in finding status of ALLOW_DEVICE_CONFIGURATION flag.

- Fixed a bug where we mistakenly printed 'disabled' even when SIP was enabled.

* Disable ncurses checks in a way that will allow compiling for other OSes! ( it was a really quick patch before )

* More changes in cmake file to make code prettier and more exact

* More cmake files cuteness

* work for supporting versions prior Sierra

This patch brings more compatibility with versions prior to Sierra.
The project as is nearly links on a 10.9.5 OSX installation.

- on versions prior Sierra clock_gettime() is not implemented thus we need to provide our own implementation for conky to work.  ( Currently we have minimal support, more studying needs to be done )

NOTE: In order to compile on versions as old as Mavericks you will need newer compilers because command line tools for 10.9.5 dont support some C++11 features... For this I donwloaded the commandline tools for Xcode 8.1 ( or 8 dont remember well ) and installed only the CommandLine Tools section with Pacifist!

( The OSX installer sees the OS as too old, so you need pacifist! )

* Oops

* $if_mounted ready

This patch removes the unneded print_mounted() function!
Also cleanup code.

* $if_up works

I think $if_up command works therefore remove the APPLE specific code in core.cc ( there wasnt anything different anyway ) and use the FreeBSD code.

Minor conky output changes in darwin.cc

* fix compatibility with Mavericks and before...

This update allows conky to be compiled on Mavericks and before by checking at compilation time what our build target is.

If it is Mavericks or lower, then cant use the csr_get_active_config func because it is not available.

On higher versions than Mavericks it works as before...

NOTE: For compiling on Mavericks or lower you will have to write 10.9 in CMAKE_OSX_DEPLOYMENT_TARGET when you run ccmake

* Added link for youtube video showing conky running on macOS

* Improvements

Minor improvements related to style
Removed unneeded free() calls

* Simplify Xcode configuration process! :)

* Removed update_cpu_usage() implementation

It was quite buggy so I removed it...

* Cleanup the source code

1. Bogus TODO comments have been deleted!
2. Started using DEBUG_MODE based printf
3. Explain some things better/cleanup

* Last small cleanup

The TODO in get_from_load_info() was unneeded.  Removed!

Also, DEBUG_MODE is enabled for now...

* update authors file

* Improve README

Make it more clean and easier to understand.

* Update README.md

small tweak

* Work for conforming with "Development" rules

1. Add to variables.xml documentation about the $sip_status variable.
2. Add sip_status variable to conkyrc.vim and nanorc to allow highlighting

3. the friends in darwin.cc is ambiguous,,, some are more than friends.

* First patch set that implements get_top_info()

:)

* Calculate cpu usage of all processes more efficiently.  (Now results match Activity Monitor's results a lot!!!)

More info about the get_top_info() implementation will come once I finish it! (soon)

* Cleanup patch!

o Move  a couple things to better places
o Rename get_sample() to get_cpu_sample() to allow to be used by different functions such as get_cpu_usage() ( this is a scene from the future... )
o Improve the way we get cpu usage for each process by passing the already created proc_taskinfo struct to the appropriate function instead of creating another one
	inside it!

* Correctly enable $running_processes variable

In our implementation update_top() doesn't calculate the count of running processes! We assign this functionality to the update_running_processes() function.

* Removed unneeded flag

This is not needed because we do not use update_top() for getting the number of running processes!

* Update README.md

* Update README.md

This adds support for TravisCL.

Though this will compile the project only on Linux it is a good sign to know if our port still can compile on Linux or we have broken things.  It seems like it can't but I suspect the problem existed before my patches.  I will investigate.

* First patch towards implementing #15

This patch a reworked get_top_info().  We now use the function get_top_info_for_kinfo_proc() to set the contents of each |process| struct.
Also, we calculate the total cpu usage and total process usage concurrently using GCD.

Aside from these we bring the function helper_get_proc_list() which makes the code simpler and cleaner.

* First fix for the algorithm that calculates % CPU usage of a process

The previous patch made the algorithm buggy.  It required more reentrant-safe functions.
Make calc_cpu_total_r() which is a more reentrant-safe reimplementation of the calc_cpu_total() function.
This is not the last commit, more are coming in the future.

* Previous commit wasn't pushed...

* Problems committing

* Make the code cleaner but break the algorithm again	#15

The algorithm doesn't work... It is a work in progress!
But this time we have merged the cpu_info and cpusample into one struct called cpusample
( I copied some variables from the linux implementation but they will probably be removed )

* Rework the code a bit / CPU usage % algorithm still doesn't work

Now get_from_load_info() is renamed to helper_update_threads_processes() and is called by both update_threads() and update_total_processes()
This makes the code nicer and removes the enum with the flags

* cleanup

remove unneeded functions, remove unneeded variables

* bugfix

* bugfix

* remove the whole get_top_info() code!

I will rework a lot this code so we can get rid of it.

* Work for #15

Now we use the ultimate solution for calculating % usage of CPU of a process!

Check the #15 Issue for information about this patch!

* Quick memory leak fix & some patches for the get_top_info algorithm

* quick patch for semaphore class

* Update the comments

* For consistency

* temp

* Revert "Merge branch 'master' into update_cpu_usage"

This reverts commit 7267a515c40d54b85107e51016703e6c10f3183e, reversing
changes made to 2190ff0b51463c12c61b3357cf846b8e705ebeb4.

* Revert "Revert "Merge branch 'master' into update_cpu_usage""

This reverts commit 692bd27a3adb2fe7027d65932467a140e42cc7bc.

* Partially implement the overall % CPU usage

* bug fix: I meant procs and threads!

* make the code better part1

* cleanup

* Stabilise the values of get_cpu_sample(). Affects get_top_info() and update_cpu_usage() ( fixes #13 and #15 )

For some reason the code that used host_statistics() function didn't produced bad values quite often.  Replaced the function with host_processor_info() and changed the algorithm
and now the values are correct!

This affects the get_top_info() and update_cpu_usage() functions which wouldn't work correctly until now.

* Finish the optimised version of get_top_info()

Fixes #15

* Quick fix for #16

Probably I will come up with a different location for get_cpu_count() because I want to conform to linux implementation.
Also, the memory leak I am mentioning in get_cpu_count() may not actually exist, as I suspected in the back of my head.

* Strictness

* Cleanup ConkyPlatformChecks.cmake

Cleanup the quick patch code for Lua.

* Add warning to README

If you are using old version of cmake, update it.  It will probably have problems when trying to locate lua.

* More cleanup

* Fix identation

This simplifies the diff.

Also, note that by merging the new code for checking for NCURSES we acheive better compatibility and easy build process

* Remove mixer related patches and files

With the newest patches from upstream, cmake checks if the header soundcard.h exists on the system.

If it doesn't exist (in the case of macOS for example) all mixer-related variables are disabled.

* Changes for using as submodule for ConkyX

* Fixes

* Implement get_freq

This implements #11
Though it doesn't support getting the **current** cpu frequency.

I haven't found a way to do it on macOS but i guess it can be done using a kernel extension. I may come back to this again in the future

* First work for correcting mem stats #6

Incorporate the update_pages_stolen() function and all of its dependencies.

I will see if I can patch the code in order to avoid license problems

* Work for #6

Now we follow the way apple's top works and not Activity Monitor.

For this reason we find different values.  But correct based on top.

* cleanup for #6

* bug fix 1

* cleanup

* hmm sorry

* More cleanup

- Move the libtop_tsamp_t object to darwin.cc.

- Remove unneeded member variables.

* A bit documentation

* Implement secondary memory stats #6

Implement memwithbuffers, memeasyfree and memfree (which isn't secondary)

* Quit update_meminfo if libtop_tsamp_update_vm_stats() failed

* Update README.md

Revert to original conky readme
Move all macOS related information to the Wiki: https://github.com/Conky-for-macOS/conky-for-macOS/wiki

* Alot junk slipped in too!

* Merge net_stats branch

For now, I have only tested up / down bytes count on en0, and it works.

This is for #14

* Corrections

- Fix License headers in darwin* files
- Remove ConkyX entry from .gitignore which slipped into from the "forConkyX" branch which was used for another project ... ConkyX.
- Cleanup top.h  (I will request the changes in a pull request finally)

* Fix identation and cleanup

* identation-fixes part1

* Try to fix problem compiling on linux

Improve checks for headers in ConkyPlatformChecks.cmake to amend the problem;
I mistakenly thought that statfs64 wasn't available in sys/statfs.h in macOS thus I tried to add platform specific code.  Though, I add the checks in the wrong place and also messed up linux-specific code by replacing checks_include sys/statfs with check_symbol_exists statfs64

* attemp to completely fix linux problem!
2018-05-07 07:27:32 -04:00
Stephane Fontaine 587631a15b Add native support for pulseaudio. (#283)
* Add native support for pulseaudio.

This adds ability to get Pulseaudio current volume without calling an
external program. Also it provides a few other parameters like card's
current profile similarly to pavucontrol. Currently it only queries the
default sink (and associated card).

* Switch to pulse async API.

This us by far the most efficient as conky subscribe to a few pulseaudio
notifications. Whenever pulseaudio server changes (volume or default
sink or default card), conky's callback updates the results.
2016-06-24 07:17:20 -07:00
Matt Sturgeon 4d205ab9a3
gedit: Make better use of gtksourceview syntax
Rewrite the gtksourceview highlighting file to make better use
of available syntax options. This allows us to separate various
contexts, and means we don't have to keep track of all conky
keywords.

Overview of changes:

* Use separate contexts for config block and "lit string".
  * (lit string is the lua lit string [[ .. ]], we assume that
    this is used to contain text sections or template blocks)
* Use "sub-string" highlighting to highlight parts of identifiers
  separately.
* Added conky.text comments (from '#' to EOL).
* Remove lists of keywords and instead rely on syntax implications.
  * Uses separate contexts for config 'key=val' and text '${var}'s.
* Match escape sequences more precisely.
  * Lua and conky escape sequences matched separately; lua in normal
    strings and conky in literal strings. See escapes note.
* Transition from camelCase to hyphen-separated names
* Reword README to reflect changes

Escapes note:

We also match conky template escape sequences when in lua literal
strings as it would be too messy to separate `conky.text` and
`templateN = ` literal strings.

We currently don't match time format escape sequences as this would
require knowing which text variable we are in. This is only possible
if we duplicate the `bracket-var` context (less painful than
duplicating the `lua-literal-string` context).

Signed-off-by: Matt Sturgeon <matt@sturgeon.me.uk>
2016-06-23 16:28:19 +01:00
Nooby4Ever dbf85da063 gedit: Add highlighting for gedit
Added a gtksourceview syntax highlighting file for conky configs.
Everything is explained in the README.md
2016-06-23 15:27:04 +01:00
Toke Høiland-Jørgensen 0db823e56c Add systemd journal support. (#214)
This adds support for reading log entries from the Systemd journal. A
new command, called simply 'journal', is added which takes a number of
lines as a parameter and optionally which journal (user or system) to
read from.

Obviously, libsystemd is required to build journal support. Tested on
Arch Linux (Systemd v229).

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
2016-05-06 07:25:30 -04:00
Marc Payne 300560dbd4 Add top_name_verbose to nano and vim syntax files 2015-12-04 20:24:44 -07:00
Franc[e]sco 162d9d13b7 added support for multiple xinerama heads (fixes issue #172) 2015-12-01 13:53:43 +01:00
Nelis Oostens 292c9919be Fixed typo in the VIM syntax highlight
As stated in: http://sourceforge.net/p/conky/bugs/440/
2015-08-14 15:19:12 +02:00
Pavel Labath b96f112106 Make $exec et al. use the new callback system
I removed the code for automatic killing of stuck children, because (by admission of the person
who wrote it) it wasn't working. I also removed the $pre_exec variable, because one can use lua
to generate the config on the startup, if one wants to.
2011-02-27 22:43:32 +01:00
Pavel Labath 25c1b1d919 convert.lua: if the string countains a backslash, don't quote with '' 2010-11-25 13:49:56 +01:00
Nikolas Garofil 773b53b94d Make sure 'continuing from mem'-msg is also visible when removing old syntax configurations 2010-11-22 15:45:29 +01:00
Nikolas Garofil 0d956d8d8b Use files instead of STDIN and STDOUT for convert.lua 2010-11-22 14:21:53 +01:00
Pavel Labath 5c49c52a0b make convert.lua "bimodal"
it does The Right Thing(tm) both when called from conky and as standalone
2010-11-21 22:26:35 +01:00
Pavel Labath 9f7e696a85 Remove the $include variable
the way it is implemented now just wont work with the new config file. And i don't think that
many people used it anyway. Maybe add a replacement later?
2010-09-15 23:34:47 +02:00
Pavel Labath ed70663b99 Make minimum_{width,height} lua settings 2010-08-26 17:40:53 +02:00
Pavel Labath 467abd2edf Make default_gauge_{width,height} lua settings 2010-08-26 17:26:34 +02:00
Pavel Labath 184afe1555 Make default_graph_{width,height} lua settings 2010-08-26 17:18:55 +02:00
Pavel Labath 34a34693d7 Make default_bar_{width,height} lua settings 2010-08-26 16:33:13 +02:00
Pavel Labath 8ff9b58c3b Fix 'nvidia with ncurses segfaults' (sf.net #3006233)
Additionally, add a nvidia_display variable. This enables the $nvidia variable to be used without
out_to_x yes (X11 support still has to be built in, you just don't have to use it).
2010-08-13 15:23:11 +02:00
Nikolas Garofil 6ab9167e38 update syntax files 2010-06-04 15:52:30 +02:00
Nikolas Garofil 54d4e6518d Add support for out_to_http 2010-06-04 14:41:12 +02:00
Nikolas Garofil 3f7ecb3a26 Add support for $irc 2010-04-30 19:32:42 +02:00
Nikolas Garofil a13c56a7a5 Add support for $ical 2010-04-27 16:42:21 +02:00
Nikolas Garofil a2ae025f56 Add support for $tcp_ping 2010-04-24 01:40:24 +02:00
Nikolas Garofil d6537aa678 Add support for $stock 2010-04-19 14:45:05 +02:00
Nikolas Garofil a6e63bcaa0 Add support for MySQL
Warning: Altough the current version works (for me),
the syntax of the configoptions and vars will probably change
over time. Contact me if you have ideas.

The following is a example of how you can use it now:

mysql_host someserver.com
mysql_db my_database
mysql_user loginname
mysql_password "s3cr3t"
TEXT
${mysql select var1 from some_table}${mysql select var2 from some_table}
2010-04-18 17:52:41 +02:00
Nikolas Garofil 0ab2efc2b2 Add support for $no_update 2010-04-17 15:19:44 +02:00
Nikolas Garofil 19ad7d2cc3 Add support for $read_udp 2010-04-16 18:53:48 +02:00