[PYTHON] Leading engineers stick to the Mac menu bar

This article is the 13th day article of Sansan Advent Calendar 2019.

Leading professionals don't care about any trivial matter. You should be especially careful about the tools you use every day.

If you are a professional baseball player, you will be polishing your bats and grope every day. If you are a carpenter, you should never neglect to take care of your mallet and kettle.

If you're a professional engineer, cleaning your mouse and keyboard is a daily routine. However, as an engineer, maintenance should not be limited to the physical part.

From a rational point of view, it is a natural result to think that the most visible and easily visible parts of the main machine work should be kept beautiful.

So where is it, the desktop? Garbage can? Root directory? ... ... ...

Well, ** Mac menu bar **!

That's why the introduction has become long, but here we will introduce ** the know-how that anyone can easily finish the status menu in the menu bar of Mac in a simple and functional manner **. If you are using Windows or Linux as your main machine, it may be difficult to refer to it directly, but the idea is the same, so please refer to it.

The disorder of the status menu is the disorder of the mind

As mentioned earlier, the status menu is ** one of the most often seen parts of your Mac screen **. It's very unsightly to see this prominent part as the default, with unused system-related icons left out and displayed for a long time. Let's take the disorder of the status menu as a disorder of the mind ** and face it seriously.

image.png

Find out how to get a sophisticated status menu

Now, the shortcut to getting closer to the sophisticated status menu is to ** display as few icons as possible **. It's simple. However, the simpler it is, the deeper it is. The status menu is a special seat at the top (or bottom) of the screen, which displays information and provides easy access on all screens. It's a sanctuary, so to speak.

Don't you think that you can be called a professional only by making good use of this? Let's aim for higher heights in this article. The answer exists in the next section.

[Method 1] Select system-related icons

** I think I'm getting tired of the roundabout expressions, so I'll explain them briefly from now on. ** ** The quickest way is to hold down the Command key and drag the icon out of the menu bar. If you accidentally delete it, open the item you want to display from "System Preferences" and check "Display in Menu Bar" to redisplay it. スクリーンショット 2019-12-13 21.48.30.png

You can erase them all, but it may be useful to keep the following icons as they are used from time to time.

[Method 2] Hide the icon with the app

I think that there are very few things that can be erased by actually organizing them. That's where Bartender 3 comes in.

Bartender is an app that hides icons with the touch of a button.

It switches between "always display icon" and "hide icon" by pressing the button, so you can always display the clock you usually see and hide the VPN connection icon that you use occasionally. .. slider-demo.gif

Bartender is a paid app, but you can try it for 4 weeks. Also, I am grateful that there is no running cost because it is not a subscription but a purchase.

Make the most of the status menu

By now, I think we have achieved the goal of ** simplifying the status menu **.

But the real value of the status menu is here. We will pick up and introduce the know-how to use the status menu more.

Make Google Japanese Icon Cool

I think that many people use Google Japanese as IME, but I think that many people feel that the default is slightly dull. Actually, this icon can be replaced with any image. image.png

Please refer to the following page for the procedure. It is explained very carefully. https://lovemac.jp/2011

Display the time in your favorite time zone

During development, I come across UTC time notation quite often, so an app called Times to be displayed in the status menu I am using. image.png

Allows you to click the time to view the calendar

I think many people are using this, but I am using an app called popCalendar. image.png

If you google it, it disappears from the App Store ...

I found a download link that seems not to be official, but it's a bit strange, so please look for it at your own risk. It's a shame because it's a very useful app.

Display your favorite information in Python

In fact, there is a library called rumps that allows you to tweak the status menu in Python. https://github.com/jaredks/rumps

image.png I used to make an app that can switch between ** "how many hours until the scheduled time" ** and ** "current USD / JPY" ** at an in-house hackathon. When I tried to move it after a long time, only the rate acquisition part did not work well for some reason ...

Therefore, only the timer part is excerpted and posted.

** The code is so poor that you can die, so please do not think deeply and use it as a reference. ** **

go_home_timer.py


import rumps
import datetime

TIMER_MODE = 'timer'
go_home_time = '18:00:00'

ICON_NEUTRAL = 'clear.png'

@rumps.clicked(u'Show remaining working hours')
def switchTimer(sender):
    global display_state
    display_state = TIMER_MODE

@rumps.timer(1)
def dispTimer(sender):
    app.icon = ICON_NEUTRAL
    app.title = 'remaining time:' + str(datetime.datetime.strptime(datetime.datetime.now().strftime('%Y/%m/%d ') + go_home_time, '%Y/%m/%d %H:%M:%S') - datetime.datetime.now()).split('.')[0]

if __name__ == "__main__":
    display_state= TIMER_MODE
    app = rumps.App("GO_HOME_TIMER", icon=ICON_NEUTRAL, title='Initializing...')
    app.run()

image.png

Summary

I think the status menu is where the individuality comes out. So, I don't think it has anything to do with productivity or professionalism, even if it's messy.

Recommended Posts

Leading engineers stick to the Mac menu bar
How to display the progress bar (tqdm)
I want to display the progress bar
Add Windows to the Linux OS boot menu