Transform your workflow with automated focus enforcement
A smart assistant that protects your coding sessions by managing distractions and communications
- 🛡️ Auto-DND Mode
Instant Discord status updates when Neovim launches - 🤖 Smart Auto-Responder
Polite replies to DMs without breaking flow - ⏱️ Intelligent Cooldown
Prevents spam with per-channel reply limits
- Python 3.11+
- Discord account
- Add the input to your flake.nix:
inputs = { focus-mode.url = "github:Gurjaka/focus-mode"; ... };
-
Then, add Focus-Mode to your packages:
environment.systemPackages = with pkgs; [ inputs.focus-mode.packages."${system}".default ];
-
For configuration check following 🛠️ Instructions
-
Expose your focus-mode input to homeManagerModules:
outputs = { self, nixpkgs, home-manager, focus-mode, ... }: { homeConfigurations.your-user = home-manager.lib.homeManagerConfiguration { ... modules = [ focus-mode.homeManagerModules.default ./home.nix ]; }; };
-
Enable and configure in your home.nix:
programs.focus-mode = { enable = true; # Use either token OR token file (tokenFile takes precedence) discordToken = "your_token_here"; # ⚠️ Do not share this for your account's safety! # In case you use Agenix encryption, this is safer way # discordTokenFile = "/run/agenix/discord_token"; focus_indicator = [ "nvim" ]; check_interval = "1"; status_dnd = "dnd"; status_normal = "idle"; reply_message = "I'm trying to focus now - I'll reply later! 🚀"; max_message_age = "300"; your_reply_window = "300"; };
-
Apply the configuration:
home-manager switch
focus-mode
If you're not using Home Manager, edit ~/.config/focus-mode/config.toml
manually:
[discord]
token = "your_token_here" # 🔑 Get from Discord client (Ctrl+Shift+I -> Network -> Filter messages -> Copy Authorization)
# In case you are using any type of encryption, this is safer way
# tokenFile = "/run/agenix/discord_token" # Recommended if using Agenix or secret managers
[settings]
focus_indicator = ["nvim"] # App that indicates focus mode
check_interval = 1
status_dnd = "dnd"
status_normal = "online"
reply_message = "I'm trying to focus now - I'll reply later! 🚀"
max_message_age = 300
your_reply_window = 300
"Finally stopped getting distracted by Discord DMs during coding sessions!" — Jane D. (Python Dev)
"The auto-responder saved me from endless DM distractions" — Mike T. (Open Source Maintainer)
- Website blocker integration
- Browser extension integration
- Slack/Teams support
- Focus time analytics
- Mobile app companion
MIT Licensed – See LICENSE for details
Made with ❤️ by Gurjaka