diff --git a/oh-my-posh/basic-nerd.toml b/oh-my-posh/basic-nerd.toml index 6ca1a33..949a0a9 100644 --- a/oh-my-posh/basic-nerd.toml +++ b/oh-my-posh/basic-nerd.toml @@ -33,6 +33,15 @@ final_space = true [blocks.segments.properties] cache_duration = 'none' + [[blocks.segments]] + style = 'plain' + type = 'command' + template = '{{ if .Output }}() {{ end }}' + [blocks.segments.properties] + shell = 'bash' + command = "echo $PATH | grep -qc /nix/store && echo true" + interpret = false + [[blocks.segments]] foreground = 'white' type = 'path' diff --git a/oh-my-posh/basic.toml b/oh-my-posh/basic.toml index f146866..25b3112 100644 --- a/oh-my-posh/basic.toml +++ b/oh-my-posh/basic.toml @@ -27,6 +27,15 @@ final_space = true template = '{{ if .SSHSession }}(SSH) {{ end }}' type = 'session' + [[blocks.segments]] + style = 'plain' + type = 'command' + template = '{{ if .Output }}(Nix-Shell) {{ end }}' + [blocks.segments.properties] + shell = 'bash' + command = "echo $PATH | grep -qc /nix/store && echo true" + interpret = false + [[blocks.segments]] style = 'plain' foreground = 'white' diff --git a/sway/config b/sway/config index 5072a32..676bc22 100755 --- a/sway/config +++ b/sway/config @@ -26,6 +26,7 @@ set $filemanager nemo set $dmenu wmenu -i set $menu j4-dmenu-desktop --no-generic --dmenu="$dmenu" set $background ~/.wallpaper +set $lock swaylock -i $background ### Output configuration # # Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) @@ -92,6 +93,9 @@ font pango:JetBrainsMonoNerdFont 9 # Kill focused window bindsym $mod+q kill + # Lock the Screen + bindsym $mod+p exec $lock + # Start your launcher bindsym $mod+Space exec $menu bindsym $mod+Shift+B exec --no-startup-id DMENU_BLUETOOTH_LAUNCHER="$dmenu" ~/.config/dotfiles/sway/dmenu-bluetooth.sh diff --git a/sway/lock.sh b/sway/lock.sh index fca64c7..e235582 100755 --- a/sway/lock.sh +++ b/sway/lock.sh @@ -7,6 +7,6 @@ read -r LS < "$LID_STATE_FILE" case "$LS" in *open) swaymsg output "$LAPTOP_OUTPUT" enable ;; -*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;; +*closed) swaylock -i ~/.wallpaper & swaymsg output "$LAPTOP_OUTPUT" disable ;; *) echo "Could not get lid state" >&2 ; exit 1 ;; esac