From 9b5f6ae5f460c8642286cf174751a317f155d043 Mon Sep 17 00:00:00 2001 From: Dennis Vesterlund Date: Thu, 21 Feb 2019 15:34:32 +0100 Subject: Added function to print content from file (#331) Added a function to print file contents to status bar without newlines. Added tests for print file contents function Added manpage entry for file contents --- man/i3status.man | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'man/i3status.man') diff --git a/man/i3status.man b/man/i3status.man index 4bc7d0a..70ba71a 100644 --- a/man/i3status.man +++ b/man/i3status.man @@ -123,6 +123,11 @@ memory { disk "/" { format = "%free" } + +read_file uptime { + path = "/proc/uptime" +} + ------------------------------------------------------------- === General @@ -611,6 +616,25 @@ volume master { } ------------------------------------------------------------- +=== File Contents + +Outputs the contents of the specified file. You can use this to check contents +of files on your system, for example /proc/uptime. By default the function only +reads the first 254 characters of the file, if you want to override this set +the Max_characters option. It will never read beyond the first 4095 characters. +If the file is not found "no file" will be printed, if the file can't be read +"error read" will be printed. + +*Example order*: read_file UPTIME + +*Example format*: "%title: %content" + +*Example format_bad*: "%title - %errno: %error" + +*Example path*: "/proc/uptime" + +*Example Max_characters*: 255 + == Universal module options When using the i3bar output format, there are a few additional options that -- cgit v1.2.3