feat: niri, new winters ip, mail fixes
Some checks failed
Flake check / Check flake (push) Has been cancelled

This commit is contained in:
Leon Schwarzäugl 2025-08-24 14:56:50 +02:00
parent 9eb02e84ad
commit 7abc476d51
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
59 changed files with 1808 additions and 965 deletions

View file

@ -6,7 +6,7 @@ command_not_found_handle() {
fi
echo -n "searching nix-index..."
ATTRS=$(@nix-locate@ --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$1")
ATTRS=$(@nix-locate@ --minimal --no-group --type x --type s --whole-name --at-root "/bin/$1")
case $(echo -n "$ATTRS" | grep -c "^") in
0)

View file

@ -1,23 +0,0 @@
headless="false"
while [[ $# -gt 0 ]]; do
case "$1" in
-h)
headless="true"
;;
*)
echo "Invalid option detected."
;;
esac
shift
done
SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)"
if [[ $headless == "true" ]]; then
wl-mirror "$SHARESCREEN"
else
wl-mirror "$SHARESCREEN" &
sleep 0.1
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 14:T'
swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
fi

View file

@ -0,0 +1,36 @@
while :; do
case ${1:-} in
-k | --kitty)
cmd=(sh -c 'kitty --app-id kittyterm -o confirm_os_window_close=0 zellij attach --create kittyterm' '&')
searchapp="kittyterm"
;;
-e | --element)
cmd=(element-desktop)
searchapp="Element"
;;
-d | --vesktop)
cmd=(vesktop)
searchapp="vesktop"
;;
-s | --spotifyplayer)
cmd=(sh -c 'kitty --add-id spotifytui -o confirm_os_window_close=0 spotify_player' '&')
searchapp="spotifytui"
;;
*) break ;;
esac
shift
done
WIN_INFO=$(niri msg -j windows | jq --arg search "$searchapp" '.[] | select (.app_id | test($search)) | { id, is_focused, workspace_id }')
ID=$(echo "$WIN_INFO" | jq -r '.id // empty')
IS_FOCUSED=$(echo "$WIN_INFO" | jq -r '.is_focused // empty')
TARGET_MONITOR=$(niri msg -j workspaces | jq --arg search "" '.[] | select (.name != null and (.name | test($search))) | { output }' | jq -r '.output // empty')
CURRENT_WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select (.is_active == true) | .output // empty')
if [ -z "$ID" ]; then
niri msg action spawn -- "${cmd[@]}"
elif [ "$IS_FOCUSED" ]; then
niri msg action move-window-to-workspace "" --window-id "$ID" --focus false
else
niri msg action focus-monitor "$TARGET_MONITOR" && niri msg action move-window-to-workspace "$CURRENT_WORKSPACE" --window-id "$ID" && niri msg action focus-floating
fi