aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryson Steck <me@brysonsteck.xyz>2023-09-13 21:36:43 -0600
committerBryson Steck <me@brysonsteck.xyz>2023-09-13 21:36:43 -0600
commit907c402cf16497f2652c406922100f4a098af942 (patch)
treed581192e57699dcf93d522a9dc6a3ed7b7303133
parent564505447e19354e596f303ab562fedca576589d (diff)
parent698a8a7f30b2a22672b677078fcfe5ac698020da (diff)
downloaddotfiles-907c402cf16497f2652c406922100f4a098af942.tar
dotfiles-907c402cf16497f2652c406922100f4a098af942.tar.gz
dotfiles-907c402cf16497f2652c406922100f4a098af942.tar.bz2
Merge branch 'master' of codeberg.org:brysonsteck/dotfiles
-rwxr-xr-xupdate.sh2
-rw-r--r--vscode/settings.json5
-rwxr-xr-xx/quitconf8
-rwxr-xr-xx/spawn-alacritty.sh37
4 files changed, 50 insertions, 2 deletions
diff --git a/update.sh b/update.sh
index 42e119c..0857190 100755
--- a/update.sh
+++ b/update.sh
@@ -13,6 +13,8 @@ cp -r ~/.vim/after ./vim
cp ~/.xinitrc* ./x
cp ~/.Xresources ./x
cp ~/.Xmodmap ./x
+cp ~/bin/spawn-alacritty ./x
+cp ~/bin/quitconf ./x
cp ~/bin/battery ./x
cp ~/bin/startdwm ./x
cp ~/.config/VSCodium/User/settings.json ./vscode
diff --git a/vscode/settings.json b/vscode/settings.json
index d56cfdb..51e87f7 100644
--- a/vscode/settings.json
+++ b/vscode/settings.json
@@ -7,7 +7,7 @@
"workbench.colorCustomizations": {
"statusBarItem.remoteBackground": "#79740e",
- "statusBar.debuggingBackground": "#d65d0e",
+ "statusBar.debuggingBackground": "#d65d0e"
},
"editor.fontFamily": "'JetBrains Mono'",
"java.configuration.runtimes": [
@@ -73,5 +73,6 @@
],
"debug.onTaskErrors": "showErrors",
"explorer.confirmDelete": false,
- "window.zoomLevel": 1
+ "window.zoomLevel": 1,
+ "errorLens.messageMaxChars": 200
} \ No newline at end of file
diff --git a/x/quitconf b/x/quitconf
new file mode 100755
index 0000000..68f8e61
--- /dev/null
+++ b/x/quitconf
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+input=$(printf "no\nyes" | dmenu -m $1 -fn "JetBrains Mono NF:style=medium:size=11" -nb $2 -nf $3 -sb "#cc241d" -sf $4 -p "Quit dwm?")
+
+if [ "$input" = "yes" ]; then
+ killall dwm
+fi
+
diff --git a/x/spawn-alacritty.sh b/x/spawn-alacritty.sh
new file mode 100755
index 0000000..7292478
--- /dev/null
+++ b/x/spawn-alacritty.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Stole from https://github.com/alacritty/alacritty/issues/808#issuecomment-334200570
+#
+# Spawn a new instance of Alacritty using the CWD of the currently focused
+# Alacritty process.
+#
+# This is useful in environment like i3 where terminals are opened using a
+# key-combination while another terminal is already focused.
+#
+# If the script is run with a non-Alacritty window in focus or a non-compliant
+# version of Alacritty, an instance will be spawned in the user's $HOME.
+
+ACTIVE_WINDOW=$(xdotool getactivewindow)
+ACTIVE_WM_CLASS=$(xprop -id $ACTIVE_WINDOW | grep WM_CLASS)
+if [[ $ACTIVE_WM_CLASS == *"Alacritty"* ]]
+then
+ # Get PID. If _NET_WM_PID isn't set, bail.
+ PID=$(xprop -id $ACTIVE_WINDOW | grep _NET_WM_PID | grep -oP "\d+")
+ if [[ "$PID" == "" ]]
+ then
+ WINIT_X11_SCALE_FACTOR=1 alacritty
+ fi
+ # Get first child of terminal
+ CHILD_PID=$(pgrep -P $PID)
+ if [[ "$PID" == "" ]]
+ then
+ WINIT_X11_SCALE_FACTOR=1 alacritty
+ fi
+ # Get current directory of child. The first child should be the shell.
+ pushd "/proc/${CHILD_PID}/cwd"
+ SHELL_CWD=$(pwd -P)
+ popd
+ # Start alacritty with the working directory
+ WINIT_X11_SCALE_FACTOR=1 alacritty --working-directory "$SHELL_CWD"
+else
+ WINIT_X11_SCALE_FACTOR=1 alacritty
+fi