Files
dotfiles/.config/wezterm/plugins/sessionizer.lua
JirR02 cd95e0ba1f Dotfiles V1.3.0
- Modified Wezterm Sessionizer
- Added .stow-local-ignore
- Added Brewfile
2025-12-28 11:22:53 +01:00

91 lines
2.6 KiB
Lua

-- Pull in the wezterm API
local wezterm = require("wezterm")
-- require plugin
local sessionizer = wezterm.plugin.require("https://github.com/mikkasendke/sessionizer.wezterm")
-- initialize module vairable
local module = {}
local edu_schema = {
options = {
prompt = "Select a project: ",
},
"default",
wezterm.home_dir .. "/Polybox_ETH/",
wezterm.home_dir .. "/Nextcloud/Vault/edu/ETH/hs25/analysis_I",
wezterm.home_dir .. "/Nextcloud/Vault/edu/ETH/hs25/einfuehrung_mikrooekonomie",
wezterm.home_dir .. "/Nextcloud/Vault/edu/ETH/hs25/information_systems_for_engineers",
wezterm.home_dir .. "/Nextcloud/Vault/edu/ETH/hs25/manufacturing_of_electronic_devices",
wezterm.home_dir .. "/Nextcloud/Vault/edu/ETH/hs25/startups_und_recht",
sessionizer.FdSearch({ fd_path = "/opt/homebrew/bin/fd", wezterm.home_dir .. "/Projects/EDU" }),
}
local sw_schema = {
options = {
prompt = "Select a project: ",
},
"default",
{ label = "JirR02", id = wezterm.home_dir .. "/Projects/JirR02" },
{ label = "blogwiki", id = wezterm.home_dir .. "/Projects/JR/blogwiki" },
sessionizer.FdSearch({ fd_path = "/opt/homebrew/bin/fd", wezterm.home_dir .. "/Projects/JR/sw" }),
sessionizer.FdSearch({ fd_path = "/opt/homebrew/bin/fd", wezterm.home_dir .. "/Projects/Private" }),
sessionizer.FdSearch({ fd_path = "/opt/homebrew/bin/fd", wezterm.home_dir .. "~/Projects/Public" }),
}
local hw_schema = {
options = {
prompt = "Select a project: ",
},
"default",
wezterm.home_dir .. "/Nextcloud/Vault/maker_space",
sessionizer.FdSearch({ fd_path = "/opt/homebrew/bin/fd", wezterm.home_dir .. "/Projects/JR/hw" }),
}
local choice = {
{ label = "EDU", id = "edu" },
{ label = "JR Software", id = "sw" },
{ label = "JR Hardware", id = "hw" },
}
-- key map
module.keys = {
{
key = "s",
mods = "LEADER",
action = wezterm.action_callback(function(window, pane)
window:perform_action(
wezterm.action.InputSelector({
title = "Choose Session Category",
choices = choice,
action = wezterm.action_callback(function(inner_window, inner_pane, id, label)
-- If the user escapes/cancels, do nothing
if not id then
return
end
-- Select the schema based on the ID chosen
local selected_schema
if id == "edu" then
selected_schema = edu_schema
elseif id == "sw" then
selected_schema = sw_schema
elseif id == "hw" then
selected_schema = hw_schema
end
-- Now trigger the actual sessionizer with the sub-schema
inner_window:perform_action(sessionizer.show(selected_schema), inner_pane)
end),
}),
pane
)
end),
},
}
return module