From e6e7940fbbe327dcdcd8e01a9d2af8bb49a76ccc Mon Sep 17 00:00:00 2001 From: Noah Swerhun Date: Sun, 2 Apr 2023 16:34:37 -0500 Subject: [PATCH] ammended readme and revised example config --- README.md | 24 +++++++- data/example_config.yml | 131 ++++++++++++++++++++++------------------ 2 files changed, 93 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index d35c57c..5841246 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,26 @@ A python script to easily configure lemonbar. +## Installation +To install the latest release: +```sh +git clone --depth 1 --branch latest https://git.noahsw.xyz/noah/easyconf-lemonbar.git +cd easyconf-lemonbar +sudo sh install.sh +``` + +## Configuration and Usage +### Config File +After installing, you will need to copy the example config file to your +XDG_CONFIG_HOME. + +```sh +cp /usr/local/share/doc/easyconf-lemonbar/example_config.yml ${HOME}/.config/easyconf-lemonbar.yml +``` + +This example file is very heavily commented. Almost all the info you will need +is contained in the file. + ### Signals You may update individual modules by sending a real-time signal to the easyconf-lemonbar process. First, in the module configuration, specify which @@ -24,8 +44,8 @@ have to read the PID from eclb's pidfile. I would recommend creating an alias in your shell as shown below. ```sh -$ alias eclb_kill="cat /run/user/${UID}/easyconf-lemonbar.pid | xargs kill" -$ eclb_kill -RTMIN+1 +alias eclb_kill="cat /run/user/${UID}/easyconf-lemonbar.pid | xargs kill" +eclb_kill -RTMIN+1 ``` This will refresh the module that is listening for signal `1`. To kill eclb diff --git a/data/example_config.yml b/data/example_config.yml index f5695af..f546663 100644 --- a/data/example_config.yml +++ b/data/example_config.yml @@ -6,40 +6,51 @@ bar: config: # Define a custom size of the bar. By default, this is different for every # screen, so the format is shown below. - geometry: "widthxheight+x+y" - # geometry: "100x200+5+10" + #geometry: "widthxheight+x+y" + # Dock the bar at the bottom of the screen. - bottom: false + #bottom: false + # Force the bar to dock (if your window manager is weird). - force: false + #force: false + # Font of display text. The default font is set by the system, and what # fonts you can use depends on what your version of lemonbar supports. See # `man lemonbar` for more info. You may define up to 5 fonts; they will be # assigned an index value 1-5 in the order you specify them (this will be # relevant later). The first font you list will be the default font for the # bar. The basic format is shown below. - font: "Font Name-Size" + #font: "Font Name-Size" #font: "Second Font Name-Size" etc... + # Set a custom Xorg WM_NAME. - name: "bar" + #name: "bar" + # Under/overline thickness in pixels. - line_thickness: 1 + #line_thickness: 1 + # Background color of the bar. - bg_color: "#000" + #bg_color: "#000" + # Color of text. - fg_color: "#FFF" + #fg_color: "#FFF" + # Vertical offset of the text in pixels (can be negative). - offset: 0 + #offset: 0 + # Global under/overline color. - line_color: "#FFF" + #line_color: "#FFF" + # Padding to the right and left of the text of any module. Formatting is # applied to the padding, too. - padding: " " + #padding: " " + # Seperator between modules. Module formatting options are not applied to # the seperator. - seperator: "|" + #seperator: "|" + # Text to be placed on both ends of the bar, before and after all text. - margin: "" + #margin: "" # Here is where you can define a list your individual modules. You can define # as many modules as you want. Some fields are required; these will be @@ -50,53 +61,53 @@ bar: # This is an example module. You can name it whatever you want, it doesn't # matter. Notice the `-` before the name. Each module must be a list item! # THIS IS A REQUIRED FIELD. - - name: "time" - # This command is run by `sh -c`, and whatever is sent to stdout is the - # text that will be displayed for this module. `date` here is used as an - # example. THIS IS A REQUIRED FIELD. - command: "date" - # How often (in milliseconds) to re-run the command and display the - # updated text. If this value is 0, then the module will not be - # refreshed. THIS IS A REQUIRED FIELD. - refresh: 1000 - # Prefix to be printed before the text of the command. - prefix: "DATE: " - # Linux real-time signal that, when received, will refresh the module - # instantly. See docs for more info. - signal: 0 - # Formatting options. These will only affect the text and padding of this - # module. - format: - # Where the text should be placed on the bar. `left`, `right`, or - # `center`. THIS IS A REQUIRED FIELD. - align: left - # Background color of the bar. - bg_color: "#000" - # Text color - fg_color: "#FFF" - # INDEX of the font for this module to be displayed in (see above). - font: 1 - # Horizontal offset of the module text in pixels (can be negative). - offset: 0 - # Set an underline or overline - line: - # Self-explanatory. `underline` or `overline`. IF you set a line, then - # this is a required field. - type: underline - # Set a custom color for the line. - color: "#000" - # Make this module act like a button. Both of these fields are required - # if you are making a button. You may also define multiple buttons with - # different activators for a single module. - button: - # What mouse click you have to make to activate the button. Can be - # `left`, `center`, or `right`. You can also set it to activate when - # you scroll up or down with `scrup` and `scrdown.` - activator: left - # Command to be executed upon activation. Will be run with `sh -c`. - command: "echo 'hello' > ~/file.txt" + #- name: "time" + # # This command is run by `sh -c`, and whatever is sent to stdout is the + # # text that will be displayed for this module. `date` here is used as an + # # example. THIS IS A REQUIRED FIELD. + # command: "date" + # # How often (in milliseconds) to re-run the command and display the + # # updated text. If this value is 0, then the module will not be + # # refreshed. THIS IS A REQUIRED FIELD. + # refresh: 1000 + # # Prefix to be printed before the text of the command. + # prefix: "DATE: " + # # Linux real-time signal that, when received, will refresh the module + # # instantly. See the README for more info. + # signal: 0 + # # Formatting options. These will only affect the text and padding of this + # # module. + # format: + # # Where the text should be placed on the bar. `left`, `right`, or + # # `center`. THIS IS A REQUIRED FIELD. + # align: left + # # Background color of the bar. + # bg_color: "#000" + # # Text color + # fg_color: "#FFF" + # # INDEX of the font for this module to be displayed in (see above). + # font: 1 + # # Horizontal offset of the module text in pixels (can be negative). + # offset: 0 + # # Set an underline or overline + # line: + # # Self-explanatory. `underline` or `overline`. IF you set a line, then + # # this is a required field. + # type: underline + # # Set a custom color for the line. + # color: "#000" + # # Make this module act like a button. Both of these fields are required + # # if you are making a button. You may also define multiple buttons with + # # different activators for a single module. + # button: + # # What mouse click you have to make to activate the button. Can be + # # `left`, `center`, or `right`. You can also set it to activate when + # # you scroll up or down with `scrup` and `scrdown.` + # activator: left + # # Command to be executed upon activation. Will be run with `sh -c`. + # command: "echo 'hello' > ~/file.txt" - # Here is a simpler example module showing only the required fields. + # Here is a simpler example to more clearly show only the required fields. - name: "bare_minimum" command: "whoami" refresh: 1000