i3 focus or run browser and mail

This commit is contained in:
Noah Masur
2023-04-01 09:41:45 -04:00
parent 2e3c376d73
commit afedfcf187
3 changed files with 34 additions and 2 deletions

View File

@ -157,6 +157,24 @@
};
};
xsession.windowManager.i3.config.keybindings =
lib.mkIf pkgs.stdenv.isLinux {
"${
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
}+Shift+b" = "exec ${
# Don't name the script `firefox` or it will affect grep
builtins.toString (pkgs.writeShellScript "focus-ff.sh" ''
count=$(ps aux | grep -c firefox)
if [ "$count" -eq 1 ]; then
i3-msg "exec --no-startup-id firefox"
sleep 0.5
fi
i3-msg "[class=firefox] focus"
'')
}";
};
};
};