update river config

This commit is contained in:
Alexander Navarro 2024-10-30 16:08:52 -03:00
parent ffa2bac00b
commit a3804e67a5
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
4 changed files with 117 additions and 27 deletions

View file

@ -1,22 +1,10 @@
#! /usr/bin/env lua
#!/usr/bin/env bash
# Wrapper for launching the configuration from lua. This will add the river
# directory to the LUA_PATH global variable so the configuration can be
# splitted into multiple files
-- ╭─────────────────────────────────────────────────────────╮
-- │ Add river config folder to Lua Path │
-- ╰─────────────────────────────────────────────────────────╯
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/river"
export LUA_PATH="$config_dir/?.lua;$config_dir/?/init.lua;$LUA_PATH"
local config_dir = os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME") .. "/.config/"
local river_config_dir = config_dir .. "river/"
package.path = river_config_dir .. '?.lua;' .. river_config_dir .. '?/init.lua;' .. package.path
local River = require('river')
local Logger = require('logger')
local logger = Logger:new()
logger:log("Initializing River configuration from Lua")
local river = River:new()
river:exec([[riverctl spawn "swaybg -i $HOME/Pictures/Minimalist__cron.png"]])
logger:close()
lua "$config_dir"/init.lua