Compare commits

...

37 commits

Author SHA1 Message Date
56c497b5dd
Update cargo.lock. 2023-10-15 16:50:31 +02:00
599a4dfac0
Bump version to 0.3.0. 2023-10-15 15:45:39 +02:00
4c0bcac50b
More meaningful error message when config file does not exist. 2023-10-15 15:44:49 +02:00
690777aa16
Merge branch 'rust-rewrite' 2023-10-15 15:35:18 +02:00
d3d4530cfd
Decrease final_workspace_delay from 1s to 100ms. 2022-12-13 16:40:14 +01:00
4e1e241bf1
Switch to logging module.
Add hint that it might be necessary to increase the timeout
if programs are left after execution.

Turn off the new window callback to avoid asyncio exceptions.
2022-12-13 16:35:14 +01:00
7b8c6df478
Always re-reduce expression. 2022-11-27 03:49:14 +01:00
015849345d
Fix not able to execute init repeatedly. 2022-11-27 03:02:56 +01:00
8763d8a382
More fixes for defun and more elaborate example in readme. 2022-11-27 02:46:38 +01:00
74e98f7e3b
Small fixes for user-defined functions, update readme. 2022-11-27 01:51:38 +01:00
ddabe282a4
Add defun (custom functions).
Rename defvar to setq, add local environment and let.
2022-11-27 01:43:27 +01:00
8b7e6ae7ba
Improve lisp compiler and interpreter. 2022-11-27 00:41:52 +01:00
be97b30e86
Improve lisp compiler and interpreter. 2022-11-27 00:32:20 +01:00
4180e3b427
Add branching operator, explicitly load values from input dict. 2022-11-09 11:59:25 +01:00
932a36517b
Update readme. 2022-11-05 16:21:35 +01:00
092a4bccfe
Fix simple command. 2022-11-05 15:01:48 +01:00
ef8bf677ae
Specify final workspace to switch to after startup. 2022-10-29 14:47:17 +02:00
e127cdde6a
Remove debug delay. 2022-10-29 14:42:02 +02:00
fd777c2683
Update readme. 2022-10-29 14:30:09 +02:00
794b032cca
Improve stability and input validation. 2022-10-29 14:05:17 +02:00
ba5d560a01
Add timeout to signal awaiting configs. 2022-10-29 12:37:28 +02:00
6f49d819ac
Prevent potential racing conditions.
Prevent abort if superflous signal is received.
2022-10-29 02:52:41 +02:00
c10b9fdb66
Add note in readme about not specifying workspaces. 2022-10-29 02:09:02 +02:00
9f4853485d
Don't run into timeout if some programs don't specify a workspace. 2022-10-29 02:07:14 +02:00
53f8ca5eec
Update readme. 2022-10-29 01:53:50 +02:00
6e10cd4e41
Add ability to wait for signals between commands. 2022-10-29 01:32:57 +02:00
05dda652db
Don't split string. 2022-10-28 21:55:04 +02:00
e1beb78bfe
Fix ipc command generation. 2022-10-28 21:47:48 +02:00
6f4d9032b4
Switch to asyncio. 2022-10-20 14:39:59 +02:00
1d2623ec66
Allow program to be a list. 2022-10-20 13:47:52 +02:00
089fc6fe22
Allow multiple programs at once with a config file. 2022-10-20 13:45:39 +02:00
ec8bb73d1c
Add makefile for installation. 2022-10-20 12:44:00 +02:00
ec8fd5171f
Cleanup imports, add exit code. 2022-10-20 12:37:07 +02:00
459de18a9c
Add simple installation instructions. 2022-10-20 03:55:23 +02:00
c38d3eb577
Add requirements file. 2022-10-20 03:53:14 +02:00
2377c2eb4c
Handle initial parentheses, allow multiple arguments for program. 2022-10-20 03:52:01 +02:00
75087e5fdb
Initial implementation and readme. 2022-10-20 03:32:45 +02:00
4 changed files with 23 additions and 4 deletions

2
Cargo.lock generated
View file

@ -336,7 +336,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "i3toolwait" name = "i3toolwait"
version = "0.1.0" version = "0.3.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byteorder", "byteorder",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "i3toolwait" name = "i3toolwait"
version = "0.1.0" version = "0.3.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

17
Makefile Normal file
View file

@ -0,0 +1,17 @@
EXEC := i3toolwait
INSTALL_BASE ?= /usr/local
default: target/debug/${EXEC}
release: target/release/${EXEC}
default: target/debug/${EXEC}
install: target/release/${EXEC}
install -Dm0755 -oroot -groot $< ${INSTALL_BASE}/bin/${EXEC}
target/release/${EXEC}:
@cargo build --release
target/debug/${EXEC}:
@cargo build
.PHONY: install

View file

@ -2,7 +2,7 @@ use std::collections::HashMap;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr; use std::str::FromStr;
use anyhow::Result; use anyhow::{Context, Result};
use clap::Parser; use clap::Parser;
use log::{debug, info, warn}; use log::{debug, info, warn};
use tokio::io::AsyncReadExt; use tokio::io::AsyncReadExt;
@ -167,7 +167,9 @@ async fn main() -> Result<()> {
tokio::io::stdin().read_to_string(&mut config).await?; tokio::io::stdin().read_to_string(&mut config).await?;
} else { } else {
tokio::fs::File::open(args.config.as_ref().unwrap()) tokio::fs::File::open(args.config.as_ref().unwrap())
.await? .await.with_context(
|| format!("Failed to read config file {}", args.config.as_ref().unwrap().to_string_lossy())
)?
.read_to_string(&mut config) .read_to_string(&mut config)
.await?; .await?;
} }