diff options
Diffstat (limited to 'tv/2configs/bash')
-rw-r--r-- | tv/2configs/bash/default.nix | 23 | ||||
l--------- | tv/2configs/bash/lib | 1 |
2 files changed, 17 insertions, 7 deletions
diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index 92e2499..e38566b 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -1,8 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import <stockholm/lib>; - -{ +with import ./lib; +{ config, pkgs, ... }: { programs.bash = { interactiveShellInit = /* sh */ '' HISTCONTROL='erasedups:ignorespace' @@ -17,8 +14,20 @@ with import <stockholm/lib>; case $UID in ${shell.escape (toString config.krebs.users.tv.uid)}) - if test ''${SHLVL-1} = 1; then - case ''${XMONAD_SPAWN_WORKSPACE-} in + if test ''${SHLVL-1} = 1 && test -n "''${DISPLAY-}"; then + _CURRENT_DESKTOP_NAME=''${_CURRENT_DESKTOP_NAME-$( + ${pkgs.xorg.xprop}/bin/xprop -notype -root \ + 32i _NET_CURRENT_DESKTOP \ + 8s _NET_DESKTOP_NAMES \ + | + ${pkgs.gnused}/bin/sed -r 's/.* = //;s/"//g;s/, /\a/g' | + { + read -r _NET_CURRENT_DESKTOP + IFS=$'\a' read -ra _NET_DESKTOP_NAMES + echo "''${_NET_DESKTOP_NAMES[$_NET_CURRENT_DESKTOP]}" + } + )} + case $_CURRENT_DESKTOP_NAME in stockholm) cd ~/stockholm ;; diff --git a/tv/2configs/bash/lib b/tv/2configs/bash/lib new file mode 120000 index 0000000..dc598c5 --- /dev/null +++ b/tv/2configs/bash/lib @@ -0,0 +1 @@ +../lib
\ No newline at end of file |