mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
chezmoi: reorganise repo
This commit is contained in:
parent
b391e03c87
commit
67a78879db
278 changed files with 102 additions and 182 deletions
37
home/dot_config/wezterm/utils.lua
Normal file
37
home/dot_config/wezterm/utils.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local wezterm = require("wezterm")
|
||||
|
||||
local function is_found(str, pattern)
|
||||
return string.find(str, pattern) ~= nil
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
local function platform()
|
||||
local is_win = is_found(wezterm.target_triple, "windows")
|
||||
local is_linux = is_found(wezterm.target_triple, "linux")
|
||||
local is_mac = is_found(wezterm.target_triple, "apple")
|
||||
local os
|
||||
|
||||
if is_win then
|
||||
os = "windows"
|
||||
elseif is_linux then
|
||||
os = "linux"
|
||||
elseif is_mac then
|
||||
os = "mac"
|
||||
else
|
||||
error("Unknown platform")
|
||||
end
|
||||
|
||||
return {
|
||||
os = os,
|
||||
is_win = is_win,
|
||||
is_linux = is_linux,
|
||||
is_mac = is_mac,
|
||||
}
|
||||
end
|
||||
|
||||
local _platform = platform()
|
||||
|
||||
M.detected_os = _platform
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue