mirror of
https://github.com/Ascyii/scripts.git
synced 2026-01-01 12:54:24 -05:00
Compare commits
5 Commits
c13dc6dba1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c719d933c | |||
| 66261bd55c | |||
| 2e832658dc | |||
| ad6e94fd97 | |||
| 56fb5d12c1 |
46
other/zellij-sessionizer
Executable file
46
other/zellij-sessionizer
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
paths=$@
|
||||||
|
|
||||||
|
if [[ -z $paths ]]; then
|
||||||
|
echo "No paths were specified, usage: ./zellij-sessionizer path1 path2 etc.."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check whether the machine has fd available
|
||||||
|
if [ -x "$(command -v fd)" ]; then
|
||||||
|
selected_path=$(fd . $paths --min-depth 1 --max-depth 2 --type d | fzf)
|
||||||
|
else
|
||||||
|
# defer to find if not
|
||||||
|
selected_path=$(find $paths -mindepth 1 -maxdepth 2 -type d | fzf)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If nothing was picked, silently exit
|
||||||
|
if [[ -z $selected_path ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If no directory was selected, exit the script
|
||||||
|
if [[ -z $selected_path ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the name of the selected directory, replacing "." with "_"
|
||||||
|
session_name=$(basename "$selected_path" | tr . _)
|
||||||
|
|
||||||
|
# We're outside of zellij, so lets create a new session or attach to a new one.
|
||||||
|
if [[ -z $ZELLIJ ]]; then
|
||||||
|
cd $selected_path
|
||||||
|
|
||||||
|
# -c will make zellij to either create a new session or to attach into an existing one
|
||||||
|
zellij attach $session_name -c
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We're inside zellij so we'll open a new pane and move into the selected directory
|
||||||
|
zellij action new-pane
|
||||||
|
|
||||||
|
# Hopefully they'll someday support specifying a directory and this won't be as laggy
|
||||||
|
# thanks to @msirringhaus for getting this from the community some time ago!
|
||||||
|
zellij action write-chars "cd $selected_path" && zellij action write 10
|
||||||
14
shell/start_kmonad.sh
Executable file
14
shell/start_kmonad.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
HOST=$(hostname)
|
||||||
|
|
||||||
|
case "$HOST" in
|
||||||
|
"minoxy")
|
||||||
|
kmonad ~/dotfiles/home/dot-kmonad/hyper.kbd &
|
||||||
|
;;
|
||||||
|
"thinix")
|
||||||
|
kmonad ~/dotfiles/home/dot-kmonad/thinkpad.kbd &
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
disown
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
HOUR=$(date +%H)
|
HOUR=$(date +%H)
|
||||||
if [ "$HOUR" -ge 19 ] || [ "$HOUR" -lt 7 ]; then
|
if [ "$HOUR" -ge 19 ] || [ "$HOUR" -lt 7 ]; then
|
||||||
hyprshade on grayscale-custom
|
#hyprshade on grayscale-custom
|
||||||
dunstctl set-paused true
|
dunstctl set-paused true
|
||||||
else
|
else
|
||||||
hyprshade off
|
hyprshade off
|
||||||
|
|||||||
Reference in New Issue
Block a user