aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-10-03 16:16:56 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-10-03 16:16:56 -0500
commit23c03cd2fde16eeaac9a0647f70d89f1f9661fcc (patch)
treee12cd02ba2e83f6dec814ae9fe93c2afafb0a026
parentffaadd8efcd4ac5b4e86be63c5cbb150b98d3266 (diff)
feat(alacritty,tmux): simplify terminal setup
-rw-r--r--alacritty/.config/alacritty/alacritty.toml23
-rw-r--r--alacritty/.config/alacritty/colors.toml47
-rw-r--r--alacritty/.config/alacritty/defaults.toml21
-rwxr-xr-xalacritty/.local/bin/src18
-rwxr-xr-xalacritty/.local/share/zsh/site-functions/_src5
-rwxr-xr-xtmux/.local/bin/mksession4
6 files changed, 44 insertions, 74 deletions
diff --git a/alacritty/.config/alacritty/alacritty.toml b/alacritty/.config/alacritty/alacritty.toml
index 32e8de0..4b37de8 100644
--- a/alacritty/.config/alacritty/alacritty.toml
+++ b/alacritty/.config/alacritty/alacritty.toml
@@ -1,6 +1,19 @@
-import = [
- "/home/tobyv/.config/alacritty/defaults.toml",
- "/home/tobyv/.config/alacritty/colors.toml",
- "/home/tobyv/.config/alacritty/local.toml",
-]
live_config_reload = true
+
+[window]
+dynamic_padding = true
+opacity = 0.95
+
+[font]
+size = 15
+normal = { family = "monospace" }
+
+[mouse]
+hide_when_typing = true
+
+[keyboard]
+bindings = [
+ { action = "CreateNewWindow", key = "T", mods = "Control|Shift" },
+ { action = "ReceiveChar", key = "F", mode = "~Search", mods = "Control|Shift" },
+ { action = "ToggleFullscreen", key = "Return", mods = "Alt" },
+]
diff --git a/alacritty/.config/alacritty/colors.toml b/alacritty/.config/alacritty/colors.toml
deleted file mode 100644
index 1f1fc64..0000000
--- a/alacritty/.config/alacritty/colors.toml
+++ /dev/null
@@ -1,47 +0,0 @@
-[colors]
-transparent_background_colors = true
-indexed_colors = [
- { index = 16, color = "#fe8019" },
- { index = 17, color = "#d65d0e" },
- { index = 18, color = "#3c3836" },
- { index = 19, color = "#504945" },
- { index = 20, color = "#bdae93" },
- { index = 21, color = "#ebdbb2" },
-]
-
-[colors.cursor]
-cursor = "CellForeground"
-text = "CellBackground"
-
-[colors.selection]
-background = "CellForeground"
-text = "CellBackground"
-
-[colors.vi_mode_cursor]
-cursor = "CellForeground"
-text = "CellBackground"
-
-[colors.primary]
-background = "#1d2021"
-foreground = "#ebdbb2"
-bright_foreground = "#fbf1c7"
-
-[colors.normal]
-black = "#1d2021"
-red = "#cc241d"
-green = "#98971a"
-yellow = "#d79921"
-blue = "#458588"
-magenta = "#b16286"
-cyan = "#689d6a"
-white = "#ebdbb2"
-
-[colors.bright]
-black = "#928374"
-red = "#fb4934"
-green = "#b8bb26"
-yellow = "#fabd2f"
-blue = "#83a598"
-magenta = "#d3869b"
-cyan = "#8ec07c"
-white = "#fbf1c7"
diff --git a/alacritty/.config/alacritty/defaults.toml b/alacritty/.config/alacritty/defaults.toml
deleted file mode 100644
index 3fd1d99..0000000
--- a/alacritty/.config/alacritty/defaults.toml
+++ /dev/null
@@ -1,21 +0,0 @@
-[shell]
-program = "tmux"
-args = ["new", "-A"]
-
-[window]
-dynamic_padding = true
-opacity = 0.95
-
-[font]
-size = 15
-normal = { family = "monospace" }
-
-[mouse]
-hide_when_typing = true
-
-[keyboard]
-bindings = [
- { action = "CreateNewWindow", key = "T", mods = "Control|Shift" },
- { action = "ReceiveChar", key = "F", mode = "~Search", mods = "Control|Shift" },
- { action = "ToggleFullscreen", key = "Return", mods = "Alt" },
-]
diff --git a/alacritty/.local/bin/src b/alacritty/.local/bin/src
new file mode 100755
index 0000000..79c2333
--- /dev/null
+++ b/alacritty/.local/bin/src
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if [ ! -d "$1" ]; then
+ project="$(
+ projectr -mgE ~/.local/src |
+ fzf --tmux --tac -0 -1 -d/ --with-nth=-1 --preview='lesspipe.sh {}' --query="$1"
+ )"
+ if [ -z "$project" ]; then
+ exit 0
+ fi
+ set -- "$project"
+fi
+
+if [ ! -d "$1" ]; then
+ exit 1
+fi
+
+alacritty msg create-window -T"$(basename "$1")" --working-directory="$1"
diff --git a/alacritty/.local/share/zsh/site-functions/_src b/alacritty/.local/share/zsh/site-functions/_src
new file mode 100755
index 0000000..1fb5c30
--- /dev/null
+++ b/alacritty/.local/share/zsh/site-functions/_src
@@ -0,0 +1,5 @@
+#compdef _src src
+
+function _src {
+ _arguments "*:projects:_files -/ -W ~/.local/src"
+}
diff --git a/tmux/.local/bin/mksession b/tmux/.local/bin/mksession
index 8ca6f7a..432ef9c 100755
--- a/tmux/.local/bin/mksession
+++ b/tmux/.local/bin/mksession
@@ -1,6 +1,8 @@
#!/bin/sh
-if [ "$1" = '-' ]; then
+if [ $# -eq 0 ]; then
+ set -- "$PWD"
+elif [ "$1" = '-' ]; then
session="$(cat -)"
if [ -z "$session" ]; then
exit 0