• Login
Community
  • Login

Minimize notepad++ to tray instead of closing.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
26 Posts 6 Posters 9.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    Alan Kilborn
    last edited by May 2, 2022, 7:14 PM

    BTW, I noticed that the menu that appears when one right-clicks the tray icon is always in English, no matter what Notepad++'s localization preference is set to. That’s fine for me, so I’m not inclined to open an issue about it.

    P 1 Reply Last reply May 2, 2022, 7:22 PM Reply Quote 0
    • P
      PeterJones @Alan Kilborn
      last edited by May 2, 2022, 7:22 PM

      @alan-kilborn said in Minimize notepad++ to tray instead of closing.:

      I’m not inclined to open an issue about it

      Okay, then I have. I think that’s a general-purpose enough desire to not require a “generic user” be the one to ask for it. There shouldn’t be a menu or dialog label in the main application that isn’t translatable, IMO.

      P 1 Reply Last reply Mar 6, 2023, 3:14 PM Reply Quote 2
      • S
        Snabel42 @Alan Kilborn
        last edited by May 2, 2022, 11:53 PM

        @alan-kilborn for most applications wit this behavior, I believe I’ve seen that all other methods of closing the application besides using the X will still close the application

        The usual suspects of file menu/exit or quit, ALT+F4, tray right click + exit all quit the application

        Not saying this is right or wrong, but in my experience that’s the most common behavior.

        1 Reply Last reply Reply Quote 2
        • P PeterJones referenced this topic on May 9, 2022, 6:32 PM
        • T
          TheMARK2580 @Alan Kilborn
          last edited by May 11, 2022, 4:01 PM

          @alan-kilborn I’m only interested in closing to an icon, not +folding. I still have no idea how to use this script)

          P 1 Reply Last reply May 11, 2022, 4:16 PM Reply Quote 0
          • P
            PeterJones @TheMARK2580
            last edited by PeterJones May 11, 2022, 4:17 PM May 11, 2022, 4:16 PM

            @themark2580 ,

            I still have no idea how to use this script

            1. Install PythonScript plugin (use Plugins Admin to install it)
            2. Plugins > Python Script > New script, name = ExitNppMinimizesToSystemTray.py
              (If it doesn’t default to the %AppData%\Notepad++\Plugins\Config\PythonScript\scripts directory, make sure you choose that directory; but for a fresh installation of PythonScript, it should default there)
            3. Paste the script that @Alan-Kilborn shared and save
            4. Look at Plugins > Python Script > Scripts to make sure it’s there.
              • If you choose that script, it will run, and the Windows-standard close-window-X (or File > Close) will minimize Notepad++ – and, if you have the Settings > Preferences > Misc > Minimize to System Tray turned on, then it will minimize to the tray rather than to the normal taskbar area
              • This will keep that “feature” until you use Shift + close-window-X to really exit.
            5. If you want it to always automatically run that script, so that the close-window-X override is always minimize-to-tray for you
              1. Plugins > Python Script > Configuration… and set Initialisation to ATSTARTUP and click OK
              2. Look at Plugins > Python Script > Scripts
                • if there is an entry called startup (user), ctrl+click on that entry to edit it.
                  (Do not confuse that with startup in the same menu, which is separate, and you should not edit it)
                • if it does not exist, use Plugins > Python Script > New script, and give it the name startup.py in the same directory as you put the first script
              3. in the user startup.py that you’re now editing, add
                import ExitNppMinimizesToSystemTray
                ExitNppMinimizesToSystemTray.ENMTST()
                
                and save the changes
              4. The next time you run Notepad++, it will automatically run that script, and now windows-close-X will just minimize-to-tray instead of exiting Notepad++. As a reminder, to really exit Notepad++, you now must use shift + windows-close-X
            T 1 Reply Last reply May 11, 2022, 10:36 PM Reply Quote 1
            • T
              TheMARK2580 @PeterJones
              last edited by TheMARK2580 May 11, 2022, 10:39 PM May 11, 2022, 10:36 PM

              @peterjones

              All this does not matter, because with the script, the X button simply becomes the “minimize window” button and nothing more. Clicking on X does not prompt you to save changes to the file. I want it to be standard functionality, not a third-party script that forces me to download another additional plugin, perform some third-party manipulation, or install another additional program.

              P A 3 Replies Last reply May 11, 2022, 11:40 PM Reply Quote 0
              • P
                PeterJones @TheMARK2580
                last edited by PeterJones May 12, 2022, 2:41 PM May 11, 2022, 11:40 PM

                @themark2580 said in Minimize notepad++ to tray instead of closing.:

                All this does not matter

                Wow. Thanks for telling me and Alan that we’ve wasted all the time we’ve spent trying to help you.

                You asked how to use the script, and I told you how. If you don’t want to use it, you don’t have to.

                X button simply becomes the “minimize window” button and nothing more.

                You told us you wanted to change the behavior of the X. We told you how.

                I want it to be standard functionality

                Well, as we tried to make clear, it’s not standard functionality. And as the Forum FAQs and the “Read this before posting” say very plainly, this Forum is not where official feature requests go. Read the “Read this before posting” and the FAQ it links you to, and you can find out where feature requests actually go. (Edit: you had already created the issue, I forgot. But that makes me even more confused why you are demanding here that it be made standard functionality when you already knew we couldn’t do anything about it)

                Good luck.

                1 Reply Last reply Reply Quote 4
                • P
                  PeterJones @TheMARK2580
                  last edited by May 12, 2022, 12:24 AM

                  @themark2580 ,

                  Clicking on X does not prompt you to save changes to the file.

                  To get that functionality, one would just enter one extra line in the script, editor.saveAll() , before triggering the minimize. But since you aren’t interested in plugins, it’s irrelevant to you.

                  Hopefully, future readers might get something out of this addition.

                  T 1 Reply Last reply May 12, 2022, 3:33 PM Reply Quote 3
                  • T
                    TheMARK2580 @PeterJones
                    last edited by May 12, 2022, 3:33 PM

                    @peterjones Does this trigger a save request or does it save everything without asking?

                    P 1 Reply Last reply May 12, 2022, 3:36 PM Reply Quote 0
                    • P
                      PeterJones @TheMARK2580
                      last edited by May 12, 2022, 3:36 PM

                      @themark2580 ,

                      Just like the File > Save All, it will save all files that are already named, and it will prompt on any unnamed files (new 1 and its ilk)

                      1 Reply Last reply Reply Quote 3
                      • A
                        Alan Kilborn @TheMARK2580
                        last edited by May 18, 2022, 1:55 PM

                        @themark2580 said in Minimize notepad++ to tray instead of closing.:

                        All this does not matter, because with the script, the X button simply becomes the “minimize window” button and nothing more.

                        Yes, but the problem as originally stated dealt with your “bad habit” of pressing the X and thinking it would minimize to tray. The workaround script worked around that bad habit.

                        I want it to be standard functionality

                        It’s good to want things. It is also good to consider workarounds when you can’t have exactly what you want.

                        1 Reply Last reply Reply Quote 2
                        • K
                          klepp0906
                          last edited by Jun 15, 2022, 10:32 AM

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • P
                            PeterJones @PeterJones
                            last edited by Mar 6, 2023, 3:14 PM

                            Nearly a year ago, @alan-kilborn said in Minimize notepad++ to tray instead of closing.:

                            I’m not inclined to open an issue about it

                            and I replied,

                            Okay, then I have. I think that’s a general-purpose enough desire to not require a “generic user” be the one to ask for it. There shouldn’t be a menu or dialog label in the main application that isn’t translatable, IMO.

                            They just fixed it. I wonder what prompted them to notice and fix that issue. (I had completely forgotten about it, and was surprised when I got the notification. Then, because I didn’t link here from the issue, I had to search the forum for what prompted that issue, because it’s not something I would have run across on my own.)

                            A 1 Reply Last reply Mar 6, 2023, 3:18 PM Reply Quote 2
                            • A
                              Alan Kilborn @PeterJones
                              last edited by Mar 6, 2023, 3:18 PM

                              @PeterJones said in Minimize notepad++ to tray instead of closing.:

                              They just fixed it. I wonder what prompted them to notice and fix that issue.

                              I think a developer was working on a batch of translating issues, and just gathered that one into the batch.

                              1 Reply Last reply Reply Quote 2
                              • First post
                                Last post
                              The Community of users of the Notepad++ text editor.
                              Powered by NodeBB | Contributors