fixed directory name, made installable

This commit is contained in:
Noah Swerhun 2023-04-02 16:06:37 -05:00
parent 68fe2a4b65
commit 83cfb523f6
17 changed files with 49 additions and 9 deletions

View file

@ -1,4 +1,4 @@
# easyconf-lemonbar # easyconf-lemonbar (eclb)
A python script to easily configure lemonbar. A python script to easily configure lemonbar.
@ -20,13 +20,13 @@ refresh on its own*; it will wait for the RTMIN+1 signal. You may also configure
your module to both refresh on a time interval AND listen for a signal. your module to both refresh on a time interval AND listen for a signal.
Unfortunately, to send the signal, you cant just `pkill easyconf-lemonbar`. You Unfortunately, to send the signal, you cant just `pkill easyconf-lemonbar`. You
have to read the PID from ECL's pidfile. I would recommend creating an alias in have to read the PID from eclb's pidfile. I would recommend creating an alias in
your shell as shown below. your shell as shown below.
```sh ```sh
$ alias ecl_kill="cat /run/user/${UID}/easyconf-lemonbar.pid | xargs kill" $ alias eclb_kill="cat /run/user/${UID}/easyconf-lemonbar.pid | xargs kill"
$ ecl_kill -RTMIN+1 $ eclb_kill -RTMIN+1
``` ```
This will refresh the module that is listening for signal `1`. To kill ecl This will refresh the module that is listening for signal `1`. To kill eclb
completely, just run `ecl_kill` (after setting the above alias). completely, just run `eclb_kill` (after setting the above alias).

7
dist/easyconf-lemonbar vendored Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
cd /usr/local/share/easyconf-lemonbar
lemonbar="lemonbar $(poetry run python easyconf_lemonbar/lemonbar_command.py)"
exec poetry run python 'easyconf_lemonbar/main.py' | sh -c "${lemonbar}"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,7 @@
from os import getenv
from signal import SIGTERM, signal from signal import SIGTERM, signal
from pidfile import delete_pidfile, pidfile_name, create_pidfile from pidfile import delete_pidfile, pidfile_name, create_pidfile
from os.path import exists
from SignalRouter import SignalRouter from SignalRouter import SignalRouter
from Bar import Bar from Bar import Bar
from Module import Module from Module import Module
@ -10,7 +12,12 @@ def sigterm_handler(signal, frame):
exit() exit()
def main(): def main():
bar_config, module_config_list = get_bar_config_and_module_config_list("./data/testing_config.yml") if exists("./data/testing_config.yml"):
config_file = "./data/testing_config.yml"
else:
config_file = str(getenv("HOME")) + "/.config/easyconf-lemonbar.yml"
bar_config, module_config_list = get_bar_config_and_module_config_list(config_file)
padding = bar_config["padding"] padding = bar_config["padding"]
seperator = bar_config["seperator"] seperator = bar_config["seperator"]
margin = bar_config["margin"] margin = bar_config["margin"]

19
install.sh Normal file
View file

@ -0,0 +1,19 @@
#!/bin/sh
cwd="$(pwd)"
share="/usr/local/share/easyconf-lemonbar"
mkdir -p ${share}
cp -r easyconf_lemonbar poetry.toml pyproject.toml README.md ${share}
cd ${share}
poetry install
cd ${cwd}
bin="/usr/local/bin"
mkdir -p ${bin}
cp dist/easyconf-lemonbar ${bin}
chmod +x ${bin}/easyconf-lemonbar
doc="/usr/local/share/doc/easyconf-lemonbar"
mkdir -p ${doc}
cp data/example_config.yml ${doc}

4
run.sh
View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
lemonbar="lemonbar $(python ./easyconf-lemonbar/lemonbar_command.py)" lemonbar="lemonbar $(python ./easyconf_lemonbar/lemonbar_command.py)"
exec python './easyconf-lemonbar/main.py' | sh -c "${lemonbar}" exec python './easyconf_lemonbar/main.py' | sh -c "${lemonbar}"

7
uninstall.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
rm -r /usr/local/share/easyconf-lemonbar
rm /usr/local/bin/easyconf-lemonbar
rm -r /usr/local/share/doc/easyconf-lemonbar