This commit is contained in:
2026-11-11 17:10:01 +00:00
parent e89a101be5
commit 06bc5e9a48
8 changed files with 180 additions and 44 deletions
+13 -20
View File
@@ -1,20 +1,24 @@
system 'bash ~/main/ocaml/epq/scripts/startup.sh >/dev/null 2>&1 &'
tmp_src = '@src@'
SRC = if tmp_src == '@src@'
'~/main/ocaml/epq/scripts'
else
tmp_src
end
MAX_PROJECTS = 3
SPECIAL = {
term1: { cmd: 'kitty' },
term2: { cmd: 'kitty' },
terminal: { cmd: 'kitty' },
browser: { cmd: 'firefox' },
misc: { cmd: nil }
}
$current = 0
$p_sub = Array.new(9, 0)
system "bash #{SRC}/startup.sh >/dev/null 2>&1 &"
def project_ws(n)
:"p#{n}_#{$p_sub[$current]}"
:"p#{n}"
end
def go_project(n)
@@ -47,11 +51,11 @@ bind 'w' do
end
bind 'e' do
system 'bash ~/main/ocaml/epq/scripts/power.sh >/dev/null 2>&1 &'
system "bash #{SRC}/power.sh >/dev/null 2>&1 &"
end
bind 'd' do
system 'bash ~/main/ocaml/epq/scripts/run.sh >/dev/null 2>&1 &'
system "bash #{SRC}/run.sh >/dev/null 2>&1 &"
end
bind 'v' do
@@ -123,12 +127,8 @@ bind 'f' do
system 'kitty -e fish -c "btop" >/dev/null 2>&1 &'
end
bind '[' do |_, ws|
go_special :term1, ws
end
bind ']' do |_, ws|
go_special :term2, ws
bind 80, :none do |_, ws|
go_special :terminal, ws
end
bind 79, :none do |_, ws|
@@ -164,11 +164,4 @@ bind 82, :none do |_, ws|
go_project(n)
end
bind 80, :none do |_, ws|
next unless in_project?(ws)
$p_sub[$current] = $p_sub[$current] == 1 ? 0 : 1
go_project($current)
end
go_project(0)