├── .gitignore ├── .travis.yml ├── Common ├── MenuMeterCPU.h ├── MenuMeterDefaults.h ├── MenuMeterDefaults.m ├── MenuMeterDisk.h ├── MenuMeterMem.h ├── MenuMeterNet.h ├── MenuMeterPowerMate.h ├── MenuMeterPowerMate.m ├── MenuMeterWorkarounds.h ├── MenuMeterWorkarounds.m ├── MenuMeters.h └── Resources │ └── DefaultsBundleInfo.plist ├── Docs ├── GNU General Public License.rtf ├── History.txt ├── MenuMeters FAQ.rtf ├── MenuMeters Read Me.rtf ├── MenuMeters Source ReadMe.rtf └── Website - Donate.webloc ├── InfoPlistPreprocessor.h ├── LICENSE ├── LocalizedStrings.h ├── LocalizedStrings.m ├── MenuExtras ├── MenuMeterCPU │ ├── MenuMeterCPUExtra.h │ ├── MenuMeterCPUExtra.m │ ├── MenuMeterCPUStats.h │ ├── MenuMeterCPUStats.m │ ├── MenuMeterCPUTopProcesses.h │ ├── MenuMeterCPUTopProcesses.m │ ├── MenuMeterUptime.h │ └── MenuMeterUptime.m ├── MenuMeterDisk │ ├── Icons │ │ ├── Aqua LightsIdle.tiff │ │ ├── Aqua LightsRead.tiff │ │ ├── Aqua LightsReadWrite.tiff │ │ ├── Aqua LightsWrite.tiff │ │ ├── ArrowsIdle.tiff │ │ ├── ArrowsRead.tiff │ │ ├── ArrowsReadWrite.tiff │ │ ├── ArrowsWrite.tiff │ │ ├── Color ArrowsIdle.tiff │ │ ├── Color ArrowsRead.tiff │ │ ├── Color ArrowsReadWrite.tiff │ │ ├── Color ArrowsWrite.tiff │ │ ├── Dark ArrowsIdle.tiff │ │ ├── Dark ArrowsRead.tiff │ │ ├── Dark ArrowsReadWrite.tiff │ │ ├── Dark ArrowsWrite.tiff │ │ ├── Dark Color ArrowsIdle.tiff │ │ ├── Dark Color ArrowsRead.tiff │ │ ├── Dark Color ArrowsReadWrite.tiff │ │ ├── Dark Color ArrowsWrite.tiff │ │ ├── Disk ArrowsRead.tiff │ │ ├── Disk ArrowsReadWrite.tiff │ │ ├── Disk ArrowsWrite.tiff │ │ ├── LightsIdle.tiff │ │ ├── LightsRead.tiff │ │ ├── LightsReadWrite.tiff │ │ └── LightsWrite.tiff │ ├── MenuMeterDiskExtra.h │ ├── MenuMeterDiskExtra.m │ ├── MenuMeterDiskIO.h │ ├── MenuMeterDiskIO.m │ ├── MenuMeterDiskSpace.h │ └── MenuMeterDiskSpace.m ├── MenuMeterMem │ ├── MenuMeterMemExtra.h │ ├── MenuMeterMemExtra.m │ ├── MenuMeterMemStats.h │ └── MenuMeterMemStats.m └── MenuMeterNet │ ├── MenuMeterNetConfig.h │ ├── MenuMeterNetConfig.m │ ├── MenuMeterNetExtra.h │ ├── MenuMeterNetExtra.m │ ├── MenuMeterNetPPP.h │ ├── MenuMeterNetPPP.m │ ├── MenuMeterNetStats.h │ └── MenuMeterNetStats.m ├── MenuMeters-Info.plist ├── MenuMeters.entitlements ├── MenuMeters.pch ├── MenuMeters.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ ├── MenuMeters.xccheckout │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ ├── MenuMeters No Sparkle.xcscheme │ └── MenuMeters.xcscheme ├── MenuMetersApp ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ └── foo.png ├── Base.lproj │ └── Localizable.strings ├── Info.plist ├── MenuMeters.icns ├── MenuMetersMainMenu.xib ├── de.lproj │ └── Localizable.strings ├── dsa_pub.pem ├── en.lproj │ └── Localizable.strings ├── fi.lproj │ └── Localizable.strings ├── fr.lproj │ └── Localizable.strings ├── generateLocalizableStrings.perl ├── it.lproj │ └── Localizable.strings ├── ja.lproj │ └── Localizable.strings ├── main.m ├── nl.lproj │ └── Localizable.strings ├── tr.lproj │ └── Localizable.strings └── zh-Hans.lproj │ └── Localizable.strings ├── MenuMetersMenuExtraBase.h ├── MenuMetersMenuExtraBase.m ├── PrefPane ├── Base.lproj │ └── MenuMetersPref.xib ├── EMCLoginItem.h ├── EMCLoginItem.m ├── Icon │ └── MenuMetersPref.tiff ├── Info.plist ├── InfoPlist.strings ├── MenuMetersPref.h ├── MenuMetersPref.m ├── Scales │ ├── CubeRootScale.tiff │ ├── LinearScale.tiff │ ├── LogScale.tiff │ └── SquareRootScale.tiff ├── de.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── en.lproj │ └── DiskImageSet.strings ├── fi.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── fr.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── it.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── ja.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── nl.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── tr.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── v2.0.8alert.rtf └── zh-Hans.lproj │ ├── DiskImageSet.strings │ └── MenuMetersPref.strings ├── README.md ├── Sparkle.framework ├── Headers ├── Modules ├── PrivateHeaders ├── Resources ├── Sparkle └── Versions │ ├── A │ ├── Headers │ │ ├── SPUDownloadData.h │ │ ├── SPUDownloader.h │ │ ├── SPUDownloaderDelegate.h │ │ ├── SPUDownloaderDeprecated.h │ │ ├── SPUDownloaderProtocol.h │ │ ├── SPUDownloaderSession.h │ │ ├── SPUURLRequest.h │ │ ├── SUAppcast.h │ │ ├── SUAppcastItem.h │ │ ├── SUCodeSigningVerifier.h │ │ ├── SUErrors.h │ │ ├── SUExport.h │ │ ├── SUStandardVersionComparator.h │ │ ├── SUUpdater.h │ │ ├── SUUpdaterDelegate.h │ │ ├── SUVersionComparisonProtocol.h │ │ ├── SUVersionDisplayProtocol.h │ │ └── Sparkle.h │ ├── Modules │ │ └── module.modulemap │ ├── PrivateHeaders │ │ └── SUUnarchiver.h │ ├── Resources │ │ ├── Autoupdate.app │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ ├── MacOS │ │ │ │ ├── Autoupdate │ │ │ │ └── fileop │ │ │ │ ├── PkgInfo │ │ │ │ └── Resources │ │ │ │ ├── AppIcon.icns │ │ │ │ ├── SUStatus.nib │ │ │ │ └── en.lproj │ │ │ │ └── Sparkle.strings │ │ ├── DarkAqua.css │ │ ├── Info.plist │ │ ├── SUModelTranslation.plist │ │ ├── SUStatus.nib │ │ └── en.lproj │ │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ ├── SUUpdateAlert.nib │ │ │ ├── SUUpdatePermissionPrompt.nib │ │ │ └── Sparkle.strings │ └── Sparkle │ └── Current ├── baselocalizationfixes ├── cell.perl ├── en.map ├── en.xib ├── ja.map ├── ja.xib ├── rewrite.perl └── tmp.strings ├── com.ragingmenace.MenuMeters.plist ├── hardware_reader ├── TemperatureReader.h ├── TemperatureReader.m ├── applesilicon_hardware_reader.h ├── applesilicon_hardware_reader.m ├── smc_reader.h └── smc_reader.m └── releases.html /.gitignore: -------------------------------------------------------------------------------- 1 | UserInterfaceState.xcuserstate 2 | build 3 | Build 4 | *.pbxuser 5 | *.perspectivev3 6 | *.mode1v3 7 | *~ 8 | *~.nib 9 | *~.xib 10 | .DS_Store 11 | xcuserdata/ 12 | notarized_product/ 13 | misc/ 14 | notarize 15 | prenotarized_zip/ 16 | staple-and-upload 17 | upload 18 | upload-old 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | env: 3 | - MM_SCHEME='MenuMeters' 4 | - MM_SCHEME='MenuMeters No Sparkle' 5 | osx_image: 6 | - xcode12 7 | - xcode11 8 | script: "[ \"$(sw_vers -productVersion | cut -b1-5)\" = '10.13' ] && HARD='ENABLE_HARDENED_RUNTIME=NO' ; set -o pipefail && xcodebuild -project MenuMeters.xcodeproj -scheme \"$MM_SCHEME\" -configuration Release build CODE_SIGN_IDENTITY='-' DEVELOPMENT_TEAM='' $HARD | xcpretty" 9 | -------------------------------------------------------------------------------- /Common/MenuMeterCPU.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterCPU.h 3 | // 4 | // Constants and other definitions for the CPU Meter 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | /////////////////////////////////////////////////////////////// 25 | // 26 | // Constants 27 | // 28 | /////////////////////////////////////////////////////////////// 29 | 30 | // Widths of the various displays 31 | #define kCPUPercentDisplayBorderWidth 2 32 | #define kCPUThermometerDisplayWidth 11.0f 33 | #define kCPUDisplayMultiProcGapWidth 5 34 | #define kCPULabelOnlyWidth 25 35 | 36 | // Menu item indexes 37 | #define kCPUUptimeInfoMenuIndex 4 38 | #define kCPUTaskInfoMenuIndex 6 39 | #define kCPULoadInfoMenuIndex 8 40 | #if TARGET_CPU_X86_64 41 | #define kCPUPowerLimitInfoMenuIndex 10 42 | #define kCPUProcessLabelMenuIndex 11 43 | #elif TARGET_CPU_ARM64 44 | #define kCPUProcessLabelMenuIndex 9 45 | #endif 46 | #define kCPUProcessMenuIndex (kCPUProcessLabelMenuIndex + 1) 47 | 48 | /////////////////////////////////////////////////////////////// 49 | // 50 | // Preference information 51 | // 52 | /////////////////////////////////////////////////////////////// 53 | 54 | // Pref dictionary keys 55 | #define kCPUIntervalPref @"CPUInterval" 56 | #define kCPUDisplayModePref @"CPUDisplayMode" 57 | #define kCPUPercentDisplayPref @"CPUPercentDisplayMode" 58 | #define kCPUMaxProcessCountPref @"CPUMaxProcessCount" 59 | #define kCPUGraphLengthPref @"CPUGraphLength" 60 | #define kCPUHorizontalRowsPref @"CPUHorizontalRows" 61 | #define kCPUMenuWidthPref @"CPUMenuWidth" 62 | #define kCPUAvgAllProcsPref @"CPUAverageMultiProcs" 63 | #define kCPUSumAllProcsPercentPref @"CPUSumAllProcsPercent" 64 | // Note that "Lower Half" is now reused to show only physical cores 65 | #define kCPUAvgLowerHalfProcsPref @"CPUAverageLowerHalfProcs" 66 | #define kCPUSortByUsagePref @"CPUSortByUsage" 67 | #define kCPUSystemColorPref @"CPUSystemColor" 68 | #define kCPUUserColorPref @"CPUUserColor" 69 | #define kCPUPowerMatePref @"CPUPowerMate" 70 | #define kCPUPowerMateMode @"CPUPowerMateMode" 71 | #define kCPUShowTemperature @"CPUTemperature" 72 | #define kCPUTemperatureColor @"CPUTemperatureColor" 73 | #define kCPUTemperatureSensor @"CPUTemperatureSensor" 74 | #define kCPUTemperatureSensorDefault @"CPUTemperatureSensorDefault" 75 | #define kCPUTemperatureUnit @"CPUTemperatureUnit" 76 | #define kCPUTemperatureUnitCelsius 0 77 | #define kCPUTemperatureUnitFahrenheit 1 78 | // Display modes 79 | enum { 80 | kCPUDisplayPercent = 1, 81 | kCPUDisplayGraph = 2, 82 | kCPUDisplayThermometer = 4, 83 | kCPUDisplayHorizontalThermometer = 8 84 | }; 85 | #define kCPUDisplayDefault kCPUDisplayPercent 86 | 87 | // Percent display modes 88 | enum { 89 | kCPUPercentDisplayLarge = 0, 90 | kCPUPercentDisplaySmall, 91 | kCPUPercentDisplaySplit 92 | }; 93 | #define kCPUPercentDisplayDefault kCPUPercentDisplaySmall 94 | 95 | // Process info 96 | #define kCPUProcessCountMin 0 97 | #define kCPUrocessCountMax 25 98 | #define kCPUProcessCountDefault 5 99 | 100 | // PowerMate modes 101 | enum { 102 | kCPUPowerMateGlow = 0, 103 | kCPUPowerMatePulse, 104 | kCPUPowerMateInverseGlow, 105 | kCPUPowerMateInversePulse 106 | }; 107 | #define kCPUPowerMateModeDefault kCPUPowerMateGlow 108 | 109 | // Timer 110 | #define kCPUUpdateIntervalMin 0.5f 111 | #define kCPUUpdateIntervalMax 10.0f 112 | #define kCPUUpdateIntervalDefault 1.0f 113 | 114 | // Graph display 115 | #define kCPUGraphWidthMin 11 116 | #define kCPUGraphWidthMax 88 117 | #define kCPUGraphWidthDefault 33 118 | 119 | // Thermometer display 120 | #define kCPUHorizontalRowsMin 1 121 | #define kCPUHorizontalRowsMax 8 122 | #define kCPUHorizontalRowsDefault 2 123 | 124 | // Menu width 125 | #define kCPUMenuWidthMin 60 126 | #define kCPUMenuWidthMax 400 127 | #define kCPUMenuWidthDefault 120 128 | 129 | // Multiproc averaging 130 | #define kCPUAvgAllProcsDefault NO 131 | 132 | // Multiproc sum percentage 133 | #define kCPUSumAllProcsPercentDefault NO 134 | 135 | // Least-utilized half of procs averaging 136 | #define kCPUAvgLowerHalfProcsDefault NO 137 | 138 | // Sorting by usage 139 | #define kCPUSortByUsageDefault NO 140 | 141 | // PowerMate 142 | #define kCPUPowerMateDefault NO 143 | 144 | // Show CPU temperature 145 | #define kCPUShowTemperatureDefault YES 146 | 147 | // Colors 148 | // Maraschino 149 | #define kCPUSystemColorDefault [NSColor systemRedColor] 150 | // Midnight blue 151 | #define kCPUUserColorDefault (self.isCatalinaOrLater?[NSColor systemBlueColor]:[NSColor colorWithDeviceRed:0.0f green:0.0f blue:0.5f alpha:1.0f]) 152 | // Orange 153 | #define kCPUTemperatureColorDefault [NSColor systemRedColor] 154 | -------------------------------------------------------------------------------- /Common/MenuMeterDefaults.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDefaults.h 3 | // 4 | // Preference (defaults) file reader/writer 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import "MenuMeters.h" 27 | 28 | @interface MenuMeterDefaults : NSObject 29 | 30 | #ifdef ELCAPITAN 31 | - (BOOL)loadBoolPref:(NSString *)prefName defaultValue:(BOOL)defaultValue; 32 | - (void)saveBoolPref:(NSString *)prefName value:(BOOL)value; 33 | #endif 34 | 35 | + (void)movePreferencesIfNecessary; 36 | + (MenuMeterDefaults*)sharedMenuMeterDefaults; 37 | 38 | // CPU menu prefs 39 | - (double)cpuInterval; 40 | - (int)cpuDisplayMode; 41 | - (int)cpuPercentDisplay; 42 | - (int)cpuMaxProcessCount; 43 | - (int)cpuGraphLength; 44 | - (int)cpuHorizontalRows; 45 | - (int)cpuMenuWidth; 46 | - (BOOL)cpuAvgAllProcs; 47 | - (BOOL)cpuSumAllProcsPercent; 48 | - (BOOL)cpuAvgLowerHalfProcs; 49 | - (BOOL)cpuSortByUsage; 50 | - (BOOL)cpuPowerMate; 51 | - (BOOL)cpuShowTemperature; 52 | - (int)cpuPowerMateMode; 53 | - (int)cpuTemperatureUnit; 54 | - (NSString*)cpuTemperatureSensor; 55 | - (NSColor *)cpuSystemColor; 56 | - (NSColor *)cpuUserColor; 57 | - (NSColor *)cpuTemperatureColor; 58 | - (void)saveCpuInterval:(double)interval; 59 | - (void)saveCpuDisplayMode:(int)mode; 60 | - (void)saveCpuPercentDisplay:(int)mode; 61 | - (void)saveCpuMaxProcessCount:(int)maxCount; 62 | - (void)saveCpuGraphLength:(int)length; 63 | - (void)saveCpuHorizontalRows:(int)rows; 64 | - (void)saveCpuMenuWidth:(int)width; 65 | - (void)saveCpuAvgAllProcs:(BOOL)average; 66 | - (void)saveCpuSumAllProcsPercent:(BOOL)sum; 67 | - (void)saveCpuAvgLowerHalfProcs:(BOOL)average; 68 | - (void)saveCpuSortByUsage:(BOOL)sort; 69 | - (void)saveCpuPowerMate:(BOOL)active; 70 | - (void)saveCpuTemperature:(BOOL)show; 71 | - (void)saveCpuPowerMateMode:(int)mode; 72 | - (void)saveCpuSystemColor:(NSColor *)color; 73 | - (void)saveCpuUserColor:(NSColor *)color; 74 | - (void)saveCpuTemperatureColor:(NSColor *)color; 75 | - (void)saveCpuTemperatureUnit:(int)unit; 76 | - (void)saveCpuTemperatureSensor:(NSString*)name; 77 | 78 | // Disk menu prefs 79 | - (double)diskInterval; 80 | - (int)diskImageset; 81 | - (int)diskSelectMode; 82 | - (BOOL)diskSpaceForceBaseTwo; 83 | - (void)saveDiskInterval:(double)interval; 84 | - (void)saveDiskImageset:(int)imageset; 85 | - (void)saveDiskSelectMode:(int)mode; 86 | 87 | // Mem menu prefs 88 | - (double)memInterval; 89 | - (int)memDisplayMode; 90 | - (BOOL)memUsedFreeLabel; 91 | - (int)memGraphLength; 92 | - (BOOL)memPageIndicator; 93 | - (BOOL)memPressure; 94 | - (NSColor *)memFreeColor; 95 | - (NSColor *)memUsedColor; 96 | - (NSColor *)memActiveColor; 97 | - (NSColor *)memInactiveColor; 98 | - (NSColor *)memWireColor; 99 | - (NSColor *)memCompressedColor; 100 | - (NSColor *)memPageInColor; 101 | - (NSColor *)memPageOutColor; 102 | - (void)saveMemInterval:(double)interval; 103 | - (void)saveMemDisplayMode:(int)mode; 104 | - (void)saveMemPageIndicator:(BOOL)indicator; 105 | - (void)saveMemUsedFreeLabel:(BOOL)label; 106 | - (void)saveMemPressure:(BOOL)label; 107 | - (void)saveMemGraphLength:(int)length; 108 | - (void)saveMemFreeColor:(NSColor *)color; 109 | - (void)saveMemUsedColor:(NSColor *)color; 110 | - (void)saveMemActiveColor:(NSColor *)color; 111 | - (void)saveMemInactiveColor:(NSColor *)color; 112 | - (void)saveMemWireColor:(NSColor *)color; 113 | - (void)saveMemCompressedColor:(NSColor *)color; 114 | - (void)saveMemPageInColor:(NSColor *)color; 115 | - (void)saveMemPageOutColor:(NSColor *)color; 116 | 117 | // Net menu prefs 118 | - (double)netInterval; 119 | - (int)netDisplayMode; 120 | - (int)netDisplayOrientation; 121 | - (int)netScaleMode; 122 | - (int)netScaleCalc; 123 | - (BOOL)netThroughputLabel; 124 | - (BOOL)netThroughput1KBound; 125 | - (BOOL)netThroughputBits; 126 | - (int)netGraphStyle; 127 | - (int)netGraphLength; 128 | - (NSColor *)netTransmitColor; 129 | - (NSColor *)netReceiveColor; 130 | - (NSColor *)netInactiveColor; 131 | - (NSString *)netPreferInterface; 132 | - (void)saveNetInterval:(double)interval; 133 | - (void)saveNetDisplayMode:(int)mode; 134 | - (void)saveNetDisplayOrientation:(int)orient; 135 | - (void)saveNetScaleMode:(int)mode; 136 | - (void)saveNetScaleCalc:(int)calc; 137 | - (void)saveNetThroughputLabel:(BOOL)label; 138 | - (void)saveNetThroughput1KBound:(BOOL)bound; 139 | - (void)saveNetThroughputBits:(BOOL)bits; 140 | - (void)saveNetGraphStyle:(int)style; 141 | - (void)saveNetGraphLength:(int)length; 142 | - (void)saveNetTransmitColor:(NSColor *)color; 143 | - (void)saveNetReceiveColor:(NSColor *)color; 144 | - (void)saveNetInactiveColor:(NSColor *)color; 145 | - (void)saveNetPreferInterface:(NSString *)interface; 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /Common/MenuMeterDisk.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDisk.h 3 | // 4 | // Constants and other definitions for the Disk Meter 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | /////////////////////////////////////////////////////////////// 25 | // 26 | // Constants 27 | // 28 | /////////////////////////////////////////////////////////////// 29 | 30 | typedef enum { 31 | kDiskActivityIdle = 0, 32 | kDiskActivityRead, 33 | kDiskActivityWrite, 34 | kDiskActivityReadWrite 35 | } DiskIOActivityType; 36 | 37 | /////////////////////////////////////////////////////////////// 38 | // 39 | // Preference information 40 | // 41 | /////////////////////////////////////////////////////////////// 42 | 43 | // Pref dictionary keys 44 | #define kDiskIntervalPref @"DiskInterval" 45 | #define kDiskImageSetPref @"DiskImageSet" 46 | #define kDiskSelectModePref @"DiskSelectMode" 47 | 48 | // Hidden pref keys 49 | #define kDiskSpaceForceBaseTwoPref @"DiskSpaceForceBaseTwo" 50 | 51 | // Timer 52 | #define kDiskUpdateIntervalMin 0.1f 53 | #define kDiskUpdateIntervalMax 5.0f 54 | #define kDiskUpdateIntervalDefault 0.3f 55 | 56 | // Image sets 57 | #define kDiskImageSets [NSArray arrayWithObjects: @"Color Arrows", @"Arrows", \ 58 | @"Lights", @"Aqua Lights", @"Disk Arrows", \ 59 | @"Disk Arrows (large)", nil] 60 | #define kDiskDarkImageSets [NSArray arrayWithObjects: @"Dark Color Arrows", @"Dark Arrows", \ 61 | @"Lights", @"Aqua Lights", @"Disk Arrows", \ 62 | @"Disk Arrows (large)", nil] 63 | #define kDiskImageSetDefault 0 64 | #define kDiskArrowsImageSet 4 65 | #define kDiskArrowsLargeImageSet 5 66 | 67 | // Select mode constants 68 | enum { 69 | kDiskSelectModeOpen = 0, 70 | kDiskSelectModeEject 71 | }; 72 | #define kDiskSelectModeDefault kDiskSelectModeOpen 73 | 74 | // Hidden pref defaults 75 | #define kDiskSpaceForceBaseTwoDefault NO 76 | 77 | // View width, also menubar disk icon image width/height 78 | #define kDiskViewWidth 16 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Common/MenuMeterMem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterMem.h 3 | // 4 | // Constants and other definitions for the Memory Meter 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | /////////////////////////////////////////////////////////////// 25 | // 26 | // Constants 27 | // 28 | /////////////////////////////////////////////////////////////// 29 | 30 | // Widths of the various displays 31 | #define kMemPieDisplayWidth 17.0f 32 | #define kMemNumberDisplayShortWidth 20.0f 33 | #define kMemNumberDisplayLongWidth 26.0f 34 | #define kMemNumberDisplayExtraLongWidth 34.0f 35 | #define kMemThermometerDisplayWidth 11.0f 36 | #define kMemPagingDisplayWidth 17.0f 37 | #define kMemPagingDisplayGapWidth 4.0f 38 | 39 | // Menu item indexes 40 | #define kMemUsageInfoMenuIndex 1 41 | #define kMemActiveWiredInfoMenuIndex 3 42 | #define kMemInactiveFreeInfoMenuIndex 4 43 | #define kMemCompressedInfoMenuIndex 5 44 | #define kMemVMPageInfoMenuIndex 7 45 | #define kMemVMCacheInfoMenuIndex 8 46 | #define kMemVMFaultInfoMenuIndex 9 47 | #define kMemMemPressureInfoMenuIndex 11 48 | #define kMemSwapCountInfoMenuIndex 13 49 | #define kMemSwapMaxCountInfoMenuIndex 14 50 | #define kMemSwapSizeInfoMenuIndex 15 51 | 52 | /////////////////////////////////////////////////////////////// 53 | // 54 | // Preference information 55 | // 56 | /////////////////////////////////////////////////////////////// 57 | 58 | // Pref dictionary keys 59 | #define kMemIntervalPref @"MemInterval" 60 | #define kMemDisplayModePref @"MemDisplayMode" 61 | #define kMemUsedFreeLabelPref @"MemUsedFreeLabel" 62 | #define kMemPressurePref @"MemPressure" 63 | #define kMemPageIndicatorPref @"MemPagingIndicator" 64 | #define kMemGraphLengthPref @"MemGraphLength" 65 | #define kMemFreeColorPref @"MemFreeColor" 66 | #define kMemUsedColorPref @"MemUsedColor" 67 | #define kMemActiveColorPref @"MemActiveColor" 68 | #define kMemInactiveColorPref @"MemInactiveColor" 69 | #define kMemWireColorPref @"MemWireColor" 70 | #define kMemCompressedColorPref @"MemCompressedColor" 71 | #define kMemPageInColorPref @"MemPageInColor" 72 | #define kMemPageOutColorPref @"MemPageOutColor" 73 | 74 | // Display modes 75 | enum { 76 | kMemDisplayPie = 1, 77 | kMemDisplayBar, 78 | kMemDisplayGraph, 79 | kMemDisplayNumber 80 | }; 81 | #define kMemDisplayDefault kMemDisplayPie 82 | 83 | // Used/Free label 84 | #define kMemUsedFreeLabelDefault YES 85 | 86 | #define kMemPressureDefault NO 87 | 88 | // Page indicator 89 | #define kMemPageIndicatorDefault NO 90 | 91 | // Timer 92 | #define kMemUpdateIntervalMin 1.0 93 | #define kMemUpdateIntervalMax 60.0 94 | #define kMemUpdateIntervalDefault 10.0 95 | 96 | // Graph display 97 | #define kMemGraphWidthMin 11 98 | #define kMemGraphWidthMax 88 99 | #define kMemGraphWidthDefault 33 100 | 101 | // Colors 102 | // Clover 103 | #define kMemFreeColorDefault [NSColor colorWithDeviceRed:0.0f green:0.5f blue:0.0f alpha:1.0f] 104 | // Cayenne 105 | #define kMemUsedColorDefault [NSColor colorWithDeviceRed:0.5f green:0.0f blue:0.0f alpha:1.0f] 106 | // Lime 107 | #define kMemActiveColorDefault [NSColor colorWithDeviceRed:0.5f green:1.0f blue:0.0f alpha:1.0f] 108 | // Color between Aluminum and Magnesium 109 | // (used to be Alumnium, but that was a bit dark) 110 | #define kMemInactiveColorDefault [NSColor colorWithDeviceRed:0.7f green:0.7f blue:0.7f alpha:1.0f] 111 | // Orchid 112 | #define kMemWireColorDefault [NSColor colorWithDeviceRed:0.4f green:0.4f blue:1.0f alpha:1.0f] 113 | // Maroon 114 | #define kMemCompressedColorDefault [NSColor colorWithDeviceRed:0.5f green:0.0f blue:0.25f alpha:1.0f] 115 | // Blue 116 | #define kMemPageInColorDefault [NSColor blueColor] 117 | // Red 118 | #define kMemPageOutColorDefault [NSColor redColor] 119 | // Black 120 | #define kMemPageRateColorDefault [NSColor blackColor] 121 | 122 | 123 | -------------------------------------------------------------------------------- /Common/MenuMeterNet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterNet.h 3 | // 4 | // Constants and other definitions for the Net Meter 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | 25 | /////////////////////////////////////////////////////////////// 26 | // 27 | // Constants 28 | // 29 | /////////////////////////////////////////////////////////////// 30 | 31 | // Widths of the various displays 32 | #define kNetArrowDisplayWidth 13 33 | // #define kNetNumberDisplayGapWidth 2 34 | #define kNetDisplayGapWidth 2 35 | 36 | // String for primary interface selection (primary interface) 37 | #define kNetPrimaryInterface @"primary" 38 | 39 | /////////////////////////////////////////////////////////////// 40 | // 41 | // Preference information 42 | // 43 | /////////////////////////////////////////////////////////////// 44 | 45 | // Pref dictionary keys 46 | #define kNetIntervalPref @"NetInterval" 47 | #define kNetDisplayModePref @"NetDisplayMode" 48 | #define kNetDisplayOrientationPref @"NetOrientation" 49 | #define kNetThroughputLabelPref @"NetThroughputLabel" 50 | #define kNetThroughput1KBoundPref @"NetThroughput1KBound" 51 | #define kNetThroughputBitsPref @"NetThroughputBits" 52 | #define kNetGraphStylePref @"NetGraphStyle" 53 | #define kNetGraphLengthPref @"NetGraphLength" 54 | #define kNetScaleModePref @"NetScaleMode" 55 | #define kNetScaleCalcPref @"NetScaleCalc" 56 | #define kNetPreferInterfacePref @"NetPreferInterface" 57 | #define kNetTransmitColorPref @"NetTransmitColor" 58 | #define kNetReceiveColorPref @"NetReceiveColor" 59 | #define kNetInactiveColorPref @"NetInactiveColor" 60 | 61 | // Display modes 62 | enum { 63 | kNetDisplayArrows = 1, 64 | kNetDisplayThroughput = 2, 65 | kNetDisplayGraph = 4 66 | }; 67 | #define kNetDisplayDefault kNetDisplayArrows 68 | 69 | // Display orientation 70 | enum { 71 | kNetDisplayOrientTxRx = 0, 72 | kNetDisplayOrientRxTx 73 | }; 74 | #define kNetDisplayOrientationDefault kNetDisplayOrientTxRx 75 | 76 | // Timer 77 | #define kNetUpdateIntervalMin 0.5 78 | #define kNetUpdateIntervalMax 20.0 79 | #define kNetUpdateIntervalDefault 2.0 80 | 81 | // Net scaling types 82 | enum { 83 | kNetScaleInterfaceSpeed = 0, 84 | kNetScalePeakTraffic 85 | }; 86 | #define kNetScaleDefault kNetScaleInterfaceSpeed 87 | 88 | // Net scaling calcs 89 | enum { 90 | kNetScaleCalcLinear = 0, 91 | kNetScaleCalcSquareRoot, 92 | kNetScaleCalcCubeRoot, 93 | kNetScaleCalcLog 94 | }; 95 | #define kNetScaleCalcDefault kNetScaleCalcCubeRoot 96 | 97 | // Graph display 98 | #define kNetGraphWidthMin 11 99 | #define kNetGraphWidthMax 88 100 | #define kNetGraphWidthDefault 33 101 | 102 | // Net graph styles 103 | enum { 104 | kNetGraphStyleStandard = 0, 105 | kNetGraphStyleCentered, 106 | kNetGraphStyleOpposed, 107 | kNetGraphStyleInverseOpposed 108 | }; 109 | #define kNetGraphStyleDefault kNetGraphStyleStandard 110 | 111 | // Throughput label 112 | #define kNetThroughputLabelDefault YES 113 | 114 | // Thoughput 1K bound 115 | #define kNetThroughput1KBoundDefault NO 116 | 117 | // Thoughput Bits per second 118 | #define kNetThroughputBitsDefault NO 119 | 120 | // Colors 121 | // Moss green 122 | #define kNetTransmitColorDefault (self.isCatalinaOrLater?[NSColor systemGreenColor]:[NSColor colorWithDeviceRed:0.0f green:0.5f blue:0.25f alpha:1.0f]) 123 | // Brick red 124 | #define kNetReceiveColorDefault (self.isCatalinaOrLater?[NSColor systemRedColor]:[NSColor colorWithDeviceRed:0.5f green:0.0f blue:0.0f alpha:1.0f]) 125 | // Light grey 126 | #define kNetInactiveColorDefault [NSColor secondaryLabelColor] 127 | -------------------------------------------------------------------------------- /Common/MenuMeterPowerMate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterPowerMate.h 3 | // 4 | // PowerMate support, based on sample code from Griffin 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | 29 | @interface MenuMeterPowerMate : NSObject { 30 | 31 | // IOKit connection 32 | mach_port_t masterPort; 33 | IONotificationPortRef notifyPort; 34 | CFRunLoopSourceRef notifyRunSource; 35 | io_iterator_t deviceMatchedIterator, 36 | deviceTerminatedIterator; 37 | // Connected PowerMate state 38 | BOOL devicePresent; 39 | IOUSBDeviceInterface **deviceInterface; 40 | // Glow ramping 41 | double lastGlowLevel, 42 | targetGlowLevel, 43 | rampGlowStep; 44 | NSTimer *rampTimer; 45 | 46 | } // MenuMeterPowerMate 47 | 48 | + (BOOL)powermateAttached; 49 | - (void)setGlow:(double)level; 50 | - (void)setGlow:(double)level rampInterval:(NSTimeInterval)interval; 51 | - (void)setPulse:(double)rate; 52 | - (void)stopPulse; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Common/MenuMeterWorkarounds.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterWorkarounds.h 3 | // 4 | // Various workarounds for old OS bugs that may not be applicable 5 | // (or compilable) on newer OS versions. To prevent conflicts 6 | // everything here is __private_extern__. 7 | // 8 | // Copyright (c) 2009-2014 Alex Harper 9 | // 10 | // This file is part of MenuMeters. 11 | // 12 | // MenuMeters is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License version 2 as 14 | // published by the Free Software Foundation. 15 | // 16 | // MenuMeters is distributed in the hope that it will be useful, 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU General Public License 22 | // along with MenuMeters; if not, write to the Free Software 23 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | // 25 | 26 | #import 27 | #import 28 | 29 | // OS version info 30 | __private_extern__ BOOL OSIsJaguarOrLater(void); 31 | __private_extern__ BOOL OSIsPantherOrLater(void); 32 | __private_extern__ BOOL OSIsTigerOrLater(void); 33 | __private_extern__ BOOL OSIsLeopardOrLater(void); 34 | __private_extern__ BOOL OSIsSnowLeopardOrLater(void); 35 | __private_extern__ BOOL OSIsMavericksOrLater(void); 36 | 37 | // Menu live updating (CFIndex is right-sized everywhere) 38 | __private_extern__ void LiveUpdateMenuItemTitleAndVisibility(NSMenu *, CFIndex, NSString *, BOOL); 39 | __private_extern__ void LiveUpdateMenuItemTitle(NSMenu *, CFIndex, NSString *); 40 | __private_extern__ void LiveUpdateMenu(NSMenu *); 41 | 42 | -------------------------------------------------------------------------------- /Common/MenuMeterWorkarounds.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterWorkarounds.m 3 | // 4 | // Various workarounds for old OS bugs that may not be applicable 5 | // (or compilable) on newer OS versions. To prevent conflicts 6 | // everything here is __private_extern__. 7 | // 8 | // Copyright (c) 2009-2014 Alex Harper 9 | // 10 | // This file is part of MenuMeters. 11 | // 12 | // MenuMeters is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License version 2 as 14 | // published by the Free Software Foundation. 15 | // 16 | // MenuMeters is distributed in the hope that it will be useful, 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU General Public License 22 | // along with MenuMeters; if not, write to the Free Software 23 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | // 25 | 26 | #import "MenuMeterWorkarounds.h" 27 | 28 | // Declare NSProcessInfo version tests from 10.10 29 | #ifndef ELCAPITAN 30 | #ifdef __x86_64__ 31 | typedef struct { 32 | int64_t majorVersion; 33 | int64_t minorVersion; 34 | int64_t patchVersion; 35 | } NSOperatingSystemVersion; 36 | #else 37 | typedef struct { 38 | int32_t majorVersion; 39 | int32_t minorVersion; 40 | int32_t patchVersion; 41 | } NSOperatingSystemVersion; 42 | #endif 43 | #endif 44 | 45 | @interface NSProcessInfo (MenuMetersWorkarounds) 46 | - (BOOL)isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version; 47 | @end 48 | 49 | 50 | static BOOL SystemVersionCompare(SInt32 gestVersion, int32_t major, int32_t minor) { 51 | #ifndef ELCAPITAN 52 | if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) { 53 | #endif 54 | NSOperatingSystemVersion version = { major, minor, 0 }; 55 | return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version]; 56 | #ifndef ELCAPITAN 57 | } else { 58 | SInt32 systemVersion = 0; 59 | OSStatus err = Gestalt(gestaltSystemVersion, &systemVersion); 60 | if ((err == noErr) && (systemVersion >= gestVersion)) { 61 | return YES; 62 | } else { 63 | return NO; 64 | } 65 | } 66 | #endif 67 | } 68 | 69 | __private_extern__ BOOL OSIsJaguarOrLater(void) { 70 | return SystemVersionCompare(0x1020, 10, 2); 71 | } 72 | 73 | __private_extern__ BOOL OSIsPantherOrLater(void) { 74 | return SystemVersionCompare(0x1030, 10, 3); 75 | } 76 | 77 | __private_extern__ BOOL OSIsTigerOrLater(void) { 78 | return SystemVersionCompare(0x1040, 10, 4); 79 | } 80 | 81 | __private_extern__ BOOL OSIsLeopardOrLater(void) { 82 | return SystemVersionCompare(0x1050, 10, 5); 83 | } 84 | 85 | __private_extern__ BOOL OSIsSnowLeopardOrLater(void) { 86 | return SystemVersionCompare(0x1060, 10, 6); 87 | } 88 | 89 | __private_extern__ BOOL OSIsMavericksOrLater(void) { 90 | return SystemVersionCompare(0x1090, 10, 9); 91 | } 92 | 93 | __private_extern__ void LiveUpdateMenuItemTitle(NSMenu *menu, CFIndex index, NSString *title) { 94 | LiveUpdateMenuItemTitleAndVisibility(menu, index, title, NO); 95 | } 96 | 97 | __private_extern__ void LiveUpdateMenuItemTitleAndVisibility(NSMenu *menu, CFIndex index, NSString *title, BOOL hidden) { 98 | 99 | // Update a menu itm various displays. Under 10.4 the Carbon and Cocoa menus 100 | // were not kept in sync. This problem disappeared later (not a problem in 101 | // 10.5). Since x86_64 can't call Carbon we have to wrap this in our 102 | // own call. 103 | 104 | // Guard against < 1 based values (such as the output of [NSMenu indexOfItem:] 105 | // when the item is not found. 106 | if (index < 0) return; 107 | 108 | #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 109 | // The Carbon side is set first since setting it results in a empty 110 | // title on the Cocoa side. 111 | MenuRef carbonMenu = _NSGetCarbonMenu(menu); 112 | if (carbonMenu) { 113 | SetMenuItemTextWithCFString(carbonMenu, 114 | index + 1, // Carbon menus 1-based index 115 | (CFStringRef)title); 116 | } 117 | #endif 118 | if (title) 119 | [[menu itemAtIndex:index] setTitle:title]; 120 | [[menu itemAtIndex:index] setHidden:hidden]; 121 | 122 | } // LiveUpdateMenuItemTitle 123 | 124 | __private_extern__ void LiveUpdateMenu(NSMenu *menu) { 125 | 126 | #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 127 | MenuRef carbonMenu = _NSGetCarbonMenu(menu); 128 | if (carbonMenu) { 129 | UpdateInvalidMenuItems(carbonMenu); 130 | } 131 | #endif 132 | 133 | } // LiveUpdateMenu 134 | 135 | -------------------------------------------------------------------------------- /Common/MenuMeters.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeters.h 3 | // 4 | // Shared defines for the entire project 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import "MenuMetersMenuExtraBase.h" 25 | 26 | /////////////////////////////////////////////////////////////// 27 | // 28 | // Bundle information 29 | // 30 | /////////////////////////////////////////////////////////////// 31 | 32 | // Bundle directory name of the preferences bundle 33 | #ifndef ELCAPITAN 34 | #define kPrefBundleName @"MenuMeterDefaults.bundle" 35 | #else 36 | #define kPrefBundleName @"MenuMetersApp.app/Contents/Resources/MenuMeterDefaults.bundle" 37 | #endif 38 | 39 | // Bundle ID for the CPU menu extra 40 | #define kCPUMenuBundleID @"com.ragingmenace.MenuMeterCPU" 41 | 42 | // Bundle ID for the Disk menu extra 43 | #define kDiskMenuBundleID @"com.ragingmenace.MenuMeterDisk" 44 | 45 | // Bundle ID for the Memory menu extra 46 | #define kMemMenuBundleID @"com.ragingmenace.MenuMeterMem" 47 | 48 | // Bundle ID for the Net menu extra 49 | #define kNetMenuBundleID @"com.ragingmenace.MenuMeterNet" 50 | 51 | // Bundle information for the pref pane 52 | #define kPrefPaneBundleID @"com.ragingmenace.MenuMeters" 53 | 54 | /////////////////////////////////////////////////////////////// 55 | // 56 | // Preference information 57 | // 58 | /////////////////////////////////////////////////////////////// 59 | 60 | // Since all our bundles share a single pref file we don't use the default 61 | // suite (which would be based on our bundle) and instead we load a different 62 | // domain 63 | #define kMenuMeterDefaultsDomain @"com.ragingmenace.MenuMeters" 64 | 65 | // Old name we no longer use 66 | #define kMenuMeterObsoleteDomain @"MenuMeters" 67 | 68 | // Pref versioning 69 | #define kPrefVersionKey @"MenuMeterPrefVersion" 70 | #define kCurrentPrefVersion 8 71 | 72 | /////////////////////////////////////////////////////////////// 73 | // 74 | // Notifications 75 | // 76 | /////////////////////////////////////////////////////////////// 77 | 78 | // Preferences were changed 79 | #define kPrefChangeNotification @"prefChange" 80 | 81 | // Extras unload 82 | #define kCPUMenuUnloadNotification @"cpuMenuUnload" 83 | #define kDiskMenuUnloadNotification @"diskMenuUnload" 84 | #define kMemMenuUnloadNotification @"memMenuUnload" 85 | #define kNetMenuUnloadNotification @"netMenuUnload" 86 | 87 | /////////////////////////////////////////////////////////////// 88 | // 89 | // String formats 90 | // 91 | /////////////////////////////////////////////////////////////// 92 | 93 | #define kBorderAlpha 0.8f 94 | -------------------------------------------------------------------------------- /Common/Resources/DefaultsBundleInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | MenuMeterDefaults 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | MenuMeterDefaults 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleSignature 18 | ???? 19 | NSPrincipalClass 20 | MenuMeterDefaults 21 | 22 | 23 | -------------------------------------------------------------------------------- /Docs/MenuMeters FAQ.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 2 | \readonlydoc1\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \vieww11960\viewh8260\viewkind0 5 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 6 | 7 | \f0\b\fs48 \cf0 MenuMeters FAQ\ 8 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 9 | 10 | \b0\fs22 \cf0 Version 1.8.1, Copyright \'a9 2002-2014 Alex Harper (basilisk@foobox.net)\ 11 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 12 | 13 | \b\fs28 \cf0 \ 14 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 15 | {\field{\*\fldinst{HYPERLINK "http://www.ragingmenace.com"}}{\fldrslt 16 | \fs26 \cf0 http://www.ragingmenace.com}}\ 17 | \ 18 | Contents:\ 19 | \ 20 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720 21 | 22 | \fs24 \cf0 \'95 This is a hack! Its using undocumented Apple APIs! Aren't you behaving badly?\ 23 | \'95 How can I uninstall MenuMeters?\ 24 | \'95 How do I tell how much CPU time MenuMeters itself is using? How can I decrease its CPU usage?\ 25 | \'95 I have 4 (or 8, 16, etc.) CPU cores, why does MenuMeters show information for more CPUs?\ 26 | \'95 The Net Meter shows interfaces I never use. How do I disable them?\ 27 | \'95 Open source?\ 28 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 29 | 30 | \b0 \cf0 \ 31 | \ 32 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 33 | 34 | \b \cf0 Q: 35 | \b0 This is a hack! Its using undocumented Apple APIs! Aren't you behaving badly? 36 | \b \ 37 | \ 38 | A: 39 | \b0 Guilty as charged. Its important to note, however, that the 40 | \b only 41 | \b0 undocumented API used in MenuMeters is the menu extra API itself. The routines used to gather the resource information (host_statistics, sysctl, and IOKit) are all documented.\ 42 | \ 43 | As for the menu extra API itself... I think the benefits outweigh the risk. Certainly it is possible for a misbehaving menu extra to crash the SystemUIServer. Since SystemUIServer restarts itself, a crash is not the end of the world. Hopefully in some future system release Apple will introduce an public API that is comparable to the menu extra API. I'll happily port to that API when that day comes. In the meantime I wrote what I wanted. That said, if you are the kind of person who avoids all software that goes outside the Apple guidelines, then MenuMeters is not for you. Numerous alternatives exist, and a search on any Macintosh software site should be your next step.\ 44 | \ 45 | \ 46 | 47 | \b Q: 48 | \b0 How can I uninstall MenuMeters? 49 | \b \ 50 | \ 51 | A: 52 | \b0 If you want to remove MenuMeters from your system you can use the MenuMeters installer's "Uninstall" button to automatically remove the software. Alternately you can delete the "MenuMeters.prefPane" file manually. Once uninstalled you must logout and relogin to complete the removal of MenuMeters from your system.\ 53 | \ 54 | \ 55 | 56 | \b Q: 57 | \b0 How do I tell how much CPU time MenuMeters itself is using? How can I decrease its CPU usage?\ 58 | \ 59 | 60 | \b A: 61 | \b0 The MenuMeters are plugins to SystemUIServer, and hence their CPU usage is counted into SystemUIServer's total CPU usage. To check MenuMeters CPU time use the terminal 'top' program or the Activity Monitor application to check SystemUIServer's CPU usage. I recommend using 'top -s 60' to get a wider (and thus more accurate) sample. Note that 62 | \b all 63 | \b0 SystemUIServer plugins are counted in this total (clock, iChat, etc. etc.) so not just MenuMeters is responsible. To get an accurate read on MenuMeters alone turn off all the MenuMeters and check SystemUIServer's usage then turn on the MenuMeters you use and check SystemUIServer again. 64 | \b \ 65 | \ 66 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 67 | 68 | \b0 \cf0 By its nature MenuMeters must poll the system periodically to gather data. This process uses a small amount of CPU time, and the actual process of drawing the graphics uses a little more. I expect that on current machines MenuMeters will add 1-2% additional CPU usage to SystemUIServer on average.\ 69 | \ 70 | Here are some things you can do to reduce the CPU usage of MenuMeters:\ 71 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li1080\fi-1080 72 | \cf0 \'95 Turn off meters you don't use.\ 73 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li580\fi-580 74 | \cf0 \'95 Increase the time between updates. This will significantly improve performance, at the cost of the "live" view of the system. However, the statistics gathered by MenuMeters are cumulative, meaning that slower updates does not result in lost information.\ 75 | \'95 Turn off text displays. Rendering the memory and network text displays can increase MenuMeter's CPU usage compare to just showing the graphical displays.\ 76 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 77 | \cf0 \ 78 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 79 | 80 | \b \cf0 Q: 81 | \b0 I have 4 (or 8, 16, etc.) CPU cores, why does MenuMeters show information for more CPUs?\ 82 | \ 83 | 84 | \b A: 85 | \b0 Most recent Intel CPUs support "Hyperthreading" which divides each physical CPU core into multiple virtual cores. If your computer features Hyperthreading then OS X will utilize each virtual core separately and consequently MenuMeters will display separate measurements for each virtual core.\ 86 | \ 87 | \ 88 | 89 | \b Q: 90 | \b0 The Net Meter shows interfaces I never use. How do I disable them?\ 91 | \ 92 | 93 | \b A: 94 | \b0 Network interfaces are reported on the basis of the SystemConfiguration framework. To prevent interfaces from showing in the list you must disable the interface in the Apple Network preference panel.\ 95 | \ 96 | \ 97 | 98 | \b Q: 99 | \b0 Open source?\ 100 | \ 101 | 102 | \b A: 103 | \b0 MenuMeters is released under the GNU General Public License (GPL) version 2. This makes it both "free" as in beer and "free" as in speech, for those who partition the world using that terminology (I am not one of them). MenuMeters is open source mostly because there isn't a good reason for it not to be, except, perhaps, saving myself the embarrassment of having others look at my first C code from a long time ago.\ 104 | \ 105 | Although it uses none of their code directly, MenuMeters wouldn't exist without the projects of others released as open source under a variety of licenses like the GPL, APSL, and Artistic License (see "Thanks" section of the MenuMeters Read Me for some credits).\ 106 | } -------------------------------------------------------------------------------- /Docs/MenuMeters Source ReadMe.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1265 2 | \readonlydoc1\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \vieww12160\viewh9280\viewkind0 5 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640 6 | 7 | \f0\b\fs38 \cf0 MenuMeters Source ReadMe 8 | \fs48 \ 9 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 10 | 11 | \b0\fs22 \cf0 Copyright \'a9 2002-2014 Alex Harper (basilisk@foobox.net)\ 12 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 13 | 14 | \b\fs28 \cf0 \ 15 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 16 | {\field{\*\fldinst{HYPERLINK "http://www.ragingmenace.com"}}{\fldrslt 17 | \fs26 \cf0 http://www.ragingmenace.com}} 18 | \b0\fs24 \ 19 | \ 20 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 21 | 22 | \b\fs28 \cf0 About:\ 23 | \ 24 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 25 | 26 | \b0\fs24 \cf0 This is the MenuMeters source code distribution. The source code distribution is intended for use by developers. End users who have accidentally downloaded this archive should instead download the MenuMeters binary distribution ({\field{\*\fldinst{HYPERLINK "http://www.ragingmenace.com/software/menumeters/"}}{\fldrslt http://www.ragingmenace.com/software/menumeters/}}).\ 27 | \ 28 | \ 29 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 30 | 31 | \b\fs28 \cf0 License:\ 32 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 33 | 34 | \b0\fs24 \cf0 \ 35 | MenuMeters is copyright \'a9 2002-2014 by Alex Harper and released under the GPL version 2. See the "GNU General Public License.rtf" included with this distribution for license terms.\ 36 | \ 37 | This source package also includes MenuCracker. MenuCracker is an independent project covered under the Artistic License. For MenuCracker license terms see the "Artistic License.rtf" included in the MenuCracker directory.\ 38 | \ 39 | \ 40 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 41 | 42 | \b\fs28 \cf0 Building:\ 43 | \ 44 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 45 | 46 | \b0\fs24 \cf0 MenuMeters is built using the Xcode 3.2 development tools. Older or newer versions of the Mac OS X development tools may not work. In particular, Xcode 4 does not work because it does not include the needed legacy SDK support.\ 47 | \ 48 | MenuMeters is compiled as a universal binary using Xcode 3.2 features to chose compilers and SDKs on per-architecture basis. For maximum compatibility MenuMeters is compiled with GCC 4.0 and the 10.4 SDK except where that SDK is not available (x86_64). 64-bit Intel uses GCC 4.0 and the 10.5 SDK.\ 49 | \ 50 | \ 51 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 52 | 53 | \b\fs28 \cf0 Learning the MenuExtra API:\ 54 | \ 55 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 56 | 57 | \b0\fs24 \cf0 If your goal is to learn the MenuExtra API then the MenuMeters source is probably a bad place to start. I was learning Objective-C while writing MenuMeters and make no claims that it is good example of how to build a MenuExtra. It works, but its probably not a stellar example of Objective-C design.\ 58 | \ 59 | A better place to start learning to write MenuExtras is the CocoaDevCentral NSMenuExtra tutorial ({\field{\*\fldinst{HYPERLINK "http://www.cocoadevcentral.com/articles/000078.php"}}{\fldrslt http://www.cocoadevcentral.com/articles/000078.php}}).\ 60 | \ 61 | \ 62 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 63 | 64 | \b\fs28 \cf0 Redistributing new versions:\ 65 | \ 66 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 67 | 68 | \b0\fs24 \cf0 Under the GPL you are entitled to modify and redistribute MenuMeters as you see fit. However, before creating or distributing your own modified version of MenuMeters please consider contacting me for inclusion into the main version. I generally accept new features into MenuMeters and would like to keep a single "master" version of MenuMeters to prevent user confusion. From a personal perspective this is especially important to me as nothing is more frustrating than seeing derivative versions distributed when I would have been more than happy to accept the patches into the master source tree.\ 69 | \ 70 | \ 71 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 72 | 73 | \b\fs28 \cf0 Contributing patches:\ 74 | \ 75 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 76 | 77 | \b0\fs24 \cf0 Patches to MenuMeters should be sent to the email address at the top of this file. When contributing patches please send a complete source tree, not just 'diff' output. Diff output works well for minor changes, but getting major changes merged using patch can be a problem when those patches no longer cleanly apply to the current development tree (which is often very different than the last public source release).\ 78 | \ 79 | If you are planning to submit a patch please consider contacting me before beginning work. This way you might can be sure that I or someone else have not already fixed the bug or added the feature in the current development version. This also gives you the opportunity to verify that the patch will be accepted. Sometimes I ask that new features in contributed patches be changed to better fit with other changes and my plans in general for MenuMeters. Contacting me beforehand lets us work these issues out early.\ 80 | \ 81 | Be aware that I will ask patch authors to disclaim copyright on contributed patches and either place them in the public domain or assign copyright to me. I understand that this is a potentially contentious issue, but it is unfortunately necessary. Under U.S. copyright law, copyright is most easy to defend if there is a single copyright holder. For this reason the Free Software Foundation (FSF) recommends that copyright for any GPL project be assigned to single holder (see {\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/gpl-faq.html#AssignCopyright"}}{\fldrslt http://www.gnu.org/licenses/gpl-faq.html#AssignCopyright}}). Of course, patch contributors will receive full credit in the source and history file. My intention is not to claim credit for your work, just to protect my copyright.\ 82 | \ 83 | If for some reason you are not able to place your changes in the public domain, or feel your contribution is substantial enough to warrant its own copyright, please contact me and we can discuss alternatives.\ 84 | \ 85 | Finally, I like to give all patch contributors credit in both the source and History file for the project. Usually this is done using a format like "Feature X contributed by Bob Smith (bob at smith.com)." If you prefer not to have your email address listed, or wish to remain anonymous, please let me know when you send your patch in.\ 86 | \ 87 | } -------------------------------------------------------------------------------- /Docs/Website - Donate.webloc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Docs/Website - Donate.webloc -------------------------------------------------------------------------------- /InfoPlistPreprocessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // InfoPlistPreprocessor.h 3 | // MenuMeters 4 | // 5 | // Created by Enrico Maria Crisostomo on 02/04/2017. 6 | // 7 | // 8 | 9 | #ifndef InfoPlistPreprocessor_h 10 | #define InfoPlistPreprocessor_h 11 | 12 | #define MM_VERSION 2.1.6.1 13 | #define MM_COPYRIGHT MenuMeters MM_VERSION, by many contributors 14 | 15 | #endif /* InfoPlistPreprocessor_h */ 16 | -------------------------------------------------------------------------------- /LocalizedStrings.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocalizedStrings.h 3 | // MenuMeters 4 | // 5 | // Created by Yuji on 12/7/20. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LocalizedStrings : NSObject 14 | -(NSString*)objectForKey:(NSString*)key; 15 | @end 16 | 17 | extern LocalizedStrings*localizedStrings; 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /LocalizedStrings.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocalizedStrings.m 3 | // MenuMeters 4 | // 5 | // Created by Yuji on 12/7/20. 6 | // 7 | 8 | #import "LocalizedStrings.h" 9 | LocalizedStrings*localizedStrings; 10 | @implementation LocalizedStrings 11 | -(NSString*)objectForKey:(NSString*)key 12 | { 13 | return [[NSBundle mainBundle] localizedStringForKey:key value:nil table:nil]; 14 | } 15 | +(void)load 16 | { 17 | localizedStrings=[[LocalizedStrings alloc] init]; 18 | } 19 | @end 20 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterCPUExtra.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterCPUExtra.h 3 | // 4 | // Menu Extra implementation 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import "MenuMeters.h" 27 | #import "MenuMeterDefaults.h" 28 | #import "MenuMeterCPU.h" 29 | #import "MenuMeterCPUStats.h" 30 | #import "MenuMeterCPUTopProcesses.h" 31 | #import "MenuMeterUptime.h" 32 | #import "MenuMeterPowerMate.h" 33 | #import "MenuMeterWorkarounds.h" 34 | 35 | 36 | @interface MenuMeterCPUExtra : NSMenuExtra { 37 | 38 | // Menu Extra necessities 39 | NSMenu *extraMenu; 40 | // Prefs object 41 | MenuMeterDefaults *ourPrefs; 42 | // Info gatherers 43 | MenuMeterCPUStats *cpuInfo; 44 | MenuMeterCPUTopProcesses *cpuTopProcesses; 45 | MenuMeterUptime *uptimeInfo; 46 | // PowerMate support 47 | MenuMeterPowerMate *powerMate; 48 | // Prerendered percentage text displays and their calculated width 49 | float percentWidth; 50 | // Historical data samples 51 | NSMutableArray *loadHistory; 52 | // Cached colors and theme support 53 | NSColor *userColor, 54 | *systemColor, 55 | *fgMenuThemeColor, 56 | *temperatureColor; 57 | 58 | } // MenuMeterCPUExtra 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterCPUStats.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterCPUStats.h 3 | // 4 | // Reader object for CPU information and load 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import "MenuMeterCPU.h" 32 | #import "LocalizedStrings.h" 33 | 34 | @interface MenuMeterCPULoad : NSObject 35 | @property(nonatomic) double system; 36 | @property(nonatomic) double user; 37 | @end 38 | 39 | @interface MenuMeterCPUStats : NSObject { 40 | 41 | // CPU name 42 | NSString *cpuName; 43 | // CPU clock speed 44 | NSString *clockSpeed; 45 | // Mach host 46 | host_name_port_t machHost; 47 | // Default processor set 48 | processor_set_name_port_t processorSet; 49 | // Previous processor tick data 50 | processor_cpu_load_info_t priorCPUTicks; 51 | // Localized float display 52 | NSNumberFormatter *twoDigitFloatFormatter; 53 | 54 | } // MenuMeterCPUStats 55 | 56 | // CPU info 57 | - (NSString *)cpuName; 58 | - (NSString *)cpuSpeed; 59 | - (uint32_t)numberOfCPUs; 60 | - (uint32_t)numberOfCores; 61 | - (NSString *)processorDescription; 62 | - (NSString *)coreDescription; 63 | 64 | // Load info 65 | - (NSString *)currentProcessorTasks; 66 | - (NSString *)loadAverage; 67 | - (NSArray *)currentLoadBySorting:(BOOL)sorted; 68 | - (float_t)cpuProximityTemperature; 69 | - (NSString*)cpuPowerLimitStatus; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterCPUTopProcesses.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterCPUTopProcesses.h 3 | // 4 | // Reader object for top CPU hogging process list 5 | // 6 | // Copyright (c) 2018 Hofi 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | 26 | extern NSString* const kProcessListItemPIDKey; 27 | extern NSString* const kProcessListItemProcessNameKey; 28 | extern NSString* const kProcessListItemProcessPathKey; 29 | extern NSString* const kProcessListItemUserIDKey; 30 | extern NSString* const kProcessListItemUserNameKey; 31 | extern NSString* const kProcessListItemCPUKey; 32 | 33 | @interface MenuMeterCPUTopProcesses : NSObject 34 | 35 | // Basic process info for the top maxItem most CPU hugging processes 36 | - (NSArray *)runningProcessesByCPUUsage:(NSUInteger)maxItem; 37 | 38 | - (void)startUpdateProcessList; 39 | - (void)stopUpdateProcessList; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterCPUTopProcesses.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterCPUTopProcesses.mm 3 | // 4 | // Reader object for top CPU hogging process list 5 | // 6 | // Copyright (c) 2018 Hofi 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import "MenuMeterCPUTopProcesses.h" 25 | #import "MenuMeterCPU.h" 26 | 27 | 28 | /////////////////////////////////////////////////////////////// 29 | // 30 | // Process info item key strings 31 | // 32 | /////////////////////////////////////////////////////////////// 33 | 34 | NSString* const kProcessListItemPIDKey = @"processID"; 35 | NSString* const kProcessListItemProcessNameKey = @"processName"; 36 | NSString* const kProcessListItemProcessPathKey = @"processPath"; 37 | NSString* const kProcessListItemUserIDKey = @"userID"; 38 | NSString* const kProcessListItemUserNameKey = @"userName"; 39 | NSString* const kProcessListItemCPUKey = @"cpuPercent"; 40 | 41 | /////////////////////////////////////////////////////////////// 42 | // 43 | // Private categories 44 | // 45 | /////////////////////////////////////////////////////////////// 46 | 47 | 48 | /////////////////////////////////////////////////////////////// 49 | // 50 | // init/dealloc 51 | // 52 | /////////////////////////////////////////////////////////////// 53 | 54 | @implementation MenuMeterCPUTopProcesses 55 | { 56 | NSArray*processes; 57 | NSTask*task; 58 | NSPipe*pipe; 59 | NSString*buffer; 60 | int parseState; //0 is before the first PID, COMMAND ... ; 1 is just after it saw PID, ... 61 | NSMutableArray*tempArray; 62 | } 63 | 64 | -(instancetype)init 65 | { 66 | self=[super init]; 67 | [[NSNotificationCenter defaultCenter] addObserver:self 68 | selector:@selector(taskOutput:) 69 | name:NSFileHandleReadCompletionNotification 70 | object:nil]; 71 | return self; 72 | } 73 | -(void)taskOutput:(NSNotification*)n 74 | { 75 | NSFileHandle*fh=[n object]; 76 | if(![[pipe fileHandleForReading] isEqualTo: fh]){ 77 | return; 78 | } 79 | NSData*d=[n userInfo][@"NSFileHandleNotificationDataItem"]; 80 | if([d length]){ 81 | NSString*s=[[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding]; 82 | buffer=[buffer stringByAppendingString:s]; 83 | while([buffer containsString:@"\n"]){ 84 | NSUInteger i=[buffer rangeOfString:@"\n"].location; 85 | NSString*x=[buffer substringToIndex:i]; 86 | [self dealWithLine:x]; 87 | buffer=[buffer substringFromIndex:i+1]; 88 | } 89 | [fh readInBackgroundAndNotifyForModes:@[NSRunLoopCommonModes]]; 90 | } 91 | } 92 | 93 | - (void)startUpdateProcessList { 94 | parseState=0; 95 | buffer=[NSString string]; 96 | task = [NSTask new]; 97 | task.launchPath = @"/usr/bin/top"; 98 | task.arguments =[[NSString stringWithFormat:@"-s 1 -l 0 -stats pid,cpu,uid,user,command -o cpu -n %@", @(kCPUrocessCountMax)] componentsSeparatedByString:@" "]; 99 | 100 | pipe = [NSPipe pipe]; 101 | task.standardOutput = pipe; 102 | [[pipe fileHandleForReading] readInBackgroundAndNotifyForModes:@[NSRunLoopCommonModes]]; 103 | [task launch]; 104 | } // startUpdateProcessList 105 | 106 | - (void)stopUpdateProcessList { 107 | [task terminate]; 108 | task=nil; 109 | buffer=nil; 110 | } // stopUpdateProcessList 111 | 112 | - (NSArray *)runningProcessesByCPUUsage:(NSUInteger)maxItem 113 | { 114 | return [processes subarrayWithRange:NSMakeRange(0,MIN(maxItem,processes.count))]; 115 | } 116 | -(void)dealWithLine:(NSString*)s 117 | { 118 | if(parseState==0){ 119 | if([s hasPrefix:@"PID"]){ 120 | parseState=1; 121 | tempArray=[NSMutableArray array]; 122 | } 123 | return; 124 | } 125 | if([s hasPrefix:@"Processes:"]){ 126 | parseState=0; 127 | // one sample completed 128 | processes=tempArray; 129 | return; 130 | } 131 | 132 | NSArray*a=[s componentsSeparatedByString:@" "]; 133 | NSMutableArray*x=[NSMutableArray array]; 134 | for(NSString*i in a){ 135 | if(![i isEqualToString:@""]){ 136 | [x addObject:i]; 137 | } 138 | } 139 | NSArray*commandName=[x subarrayWithRange:NSMakeRange(4,x.count-4)]; 140 | NSDictionary* entry = @{ kProcessListItemPIDKey:x[0], 141 | kProcessListItemCPUKey:x[1], 142 | kProcessListItemUserIDKey:x[2], 143 | kProcessListItemUserNameKey:x[3], 144 | kProcessListItemProcessNameKey:[self normalizedCommand:[commandName componentsJoinedByString:@" "]] 145 | }; 146 | [tempArray addObject:entry]; 147 | } 148 | 149 | 150 | 151 | 152 | - (NSString *)normalizedCommand:(NSString *)name 153 | { 154 | NSString* result = name; 155 | 156 | // remove leading/trailing whitespaces 157 | result = [result stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 158 | 159 | // remove login shell prefixes 160 | for (int i = 0; i < 2; ++i) { 161 | if (name.length > 0) { 162 | result = [result stringByReplacingOccurrencesOfString:@"-" withString:@"" options:0 range:NSMakeRange(0, 1)]; 163 | } 164 | } 165 | 166 | // continue other clean up here 167 | 168 | return result; 169 | 170 | } // normalizedCommand: 171 | 172 | 173 | @end 174 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterUptime.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterUptime.h 3 | // 4 | // Reader object for uptime 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import "LocalizedStrings.h" 26 | 27 | @interface MenuMeterUptime : NSObject { 28 | 29 | } // MenuMeterUptime 30 | 31 | // Uptime info 32 | - (NSString *)uptime; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterCPU/MenuMeterUptime.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterUptime.m 3 | // 4 | // Reader object for uptime 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import "MenuMeterUptime.h" 25 | #import 26 | #import 27 | 28 | 29 | /////////////////////////////////////////////////////////////// 30 | // 31 | // Localized strings 32 | // 33 | /////////////////////////////////////////////////////////////// 34 | 35 | #define kUptimeUnavailable @"Unavailable" 36 | #define kUptimeZeroDayFormat @"%02ld:%02ld:%02ld" 37 | #define kUptimeOneDayFormat @"%ld day %02ld:%02ld:%02ld" 38 | #define kUptimeMultiDayFormat @"%ld days %02ld:%02ld:%02ld" 39 | 40 | 41 | /////////////////////////////////////////////////////////////// 42 | // 43 | // init/dealloc 44 | // 45 | /////////////////////////////////////////////////////////////// 46 | 47 | @implementation MenuMeterUptime 48 | 49 | - (id)init { 50 | 51 | // Allow super to init 52 | self = [super init]; 53 | if (!self) { 54 | return nil; 55 | } 56 | 57 | // Set up localized strings 58 | NSBundle *selfBundle = [NSBundle bundleForClass:[self class]]; 59 | if (!selfBundle) { 60 | return nil; 61 | } 62 | 63 | // Send on back 64 | return self; 65 | 66 | } // init 67 | 68 | // dealloc 69 | 70 | /////////////////////////////////////////////////////////////// 71 | // 72 | // Uptime info 73 | // 74 | /////////////////////////////////////////////////////////////// 75 | 76 | - (NSString *)uptime { 77 | 78 | // Current time 79 | time_t now = time(NULL); 80 | 81 | // Boot time 82 | struct timeval bootTime; 83 | int mib[2] = { CTL_KERN, KERN_BOOTTIME }; 84 | size_t bootTimeSize = sizeof(bootTime); 85 | if (sysctl(mib, 2, &bootTime, &bootTimeSize, NULL, 0)) { 86 | return [localizedStrings objectForKey:kUptimeZeroDayFormat]; 87 | } 88 | 89 | // Calculate the uptime 90 | time_t uptime = now - bootTime.tv_sec; 91 | 92 | // Get our pretty string 93 | time_t days = uptime / (24 * 60 * 60); 94 | uptime %= (24 * 60 * 60); 95 | time_t hours = uptime / (60 * 60); 96 | uptime %= (60 * 60); 97 | time_t minutes = uptime / 60; 98 | uptime %= 60; 99 | time_t seconds = uptime; 100 | NSString *uptimeDesc = nil; 101 | if (days > 1) { 102 | uptimeDesc = [NSString stringWithFormat:[localizedStrings objectForKey:kUptimeMultiDayFormat], 103 | days, hours, minutes, seconds]; 104 | } else if (days == 1) { 105 | uptimeDesc = [NSString stringWithFormat:[localizedStrings objectForKey:kUptimeOneDayFormat], 106 | days, hours, minutes, seconds]; 107 | } else { 108 | uptimeDesc = [NSString stringWithFormat:[localizedStrings objectForKey:kUptimeZeroDayFormat], 109 | hours, minutes, seconds]; 110 | } 111 | 112 | // Send the string back 113 | return uptimeDesc; 114 | 115 | } // uptime 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Aqua LightsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Aqua LightsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Aqua LightsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Aqua LightsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Aqua LightsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Aqua LightsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Aqua LightsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Aqua LightsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/ArrowsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/ArrowsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/ArrowsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/ArrowsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/ArrowsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/ArrowsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/ArrowsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/ArrowsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Color ArrowsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Color ArrowsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Color ArrowsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Color ArrowsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Color ArrowsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Color ArrowsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Color ArrowsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Color ArrowsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark ArrowsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark ArrowsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark ArrowsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark ArrowsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark ArrowsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark ArrowsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark ArrowsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark ArrowsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Dark Color ArrowsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Disk ArrowsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Disk ArrowsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Disk ArrowsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Disk ArrowsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/Disk ArrowsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/Disk ArrowsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/LightsIdle.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/LightsIdle.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/LightsRead.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/LightsRead.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/LightsReadWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/LightsReadWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/Icons/LightsWrite.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuExtras/MenuMeterDisk/Icons/LightsWrite.tiff -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/MenuMeterDiskExtra.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDiskExtra.h 3 | // 4 | // Menu Extra implementation 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import "MenuMeters.h" 27 | #import "MenuMeterDefaults.h" 28 | #import "MenuMeterDisk.h" 29 | #import "MenuMeterDiskIO.h" 30 | #import "MenuMeterDiskSpace.h" 31 | #import "MenuMeterWorkarounds.h" 32 | 33 | 34 | @interface MenuMeterDiskExtra : NSMenuExtra { 35 | 36 | // Menu Extra necessities 37 | NSMenu *extraMenu; 38 | // Pref object 39 | MenuMeterDefaults *ourPrefs; 40 | // Info gatherers 41 | MenuMeterDiskIO *diskIOMonitor; 42 | MenuMeterDiskSpace *diskSpaceMonitor; 43 | // Display state and images 44 | NSImage *idleImageLight, *readImageLight, *writeImageLight, *readwriteImageLight; 45 | NSImage *idleImageDark, *readImageDark, *writeImageDark, *readwriteImageDark; 46 | DiskIOActivityType displayedActivity; 47 | // Theme support 48 | NSColor *fgMenuThemeColor; 49 | 50 | } // MenuMeterDiskExtra 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/MenuMeterDiskIO.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDiskIO.h 3 | // 4 | // Reader object for disk IO statistics 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import "MenuMeters.h" 30 | #import "MenuMeterDisk.h" 31 | 32 | 33 | @interface MenuMeterDiskIO : NSObject { 34 | 35 | // IOKit connection 36 | mach_port_t masterPort; 37 | IONotificationPortRef notifyPort; 38 | CFRunLoopSourceRef notifyRunSource; 39 | io_iterator_t blockDevicePublishedIterator, 40 | blockDeviceTerminatedIterator, 41 | blockDeviceIterator; 42 | // Tracking values 43 | uint64_t previousTotalRead, previousTotalWrite; 44 | 45 | } // MenuMeterDiskIO 46 | 47 | // Disk activity info 48 | - (DiskIOActivityType)diskIOActivity; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/MenuMeterDiskIO.m: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDiskIO.m 3 | // 4 | // Reader object for disk IO statistics 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import "MenuMeterDiskIO.h" 25 | #import 26 | 27 | 28 | /////////////////////////////////////////////////////////////// 29 | // 30 | // Private methods and constants 31 | // 32 | /////////////////////////////////////////////////////////////// 33 | 34 | @interface MenuMeterDiskIO (PrivateMethods) 35 | -(void)blockDeviceChanged:(io_iterator_t)iterator; 36 | @end 37 | 38 | /////////////////////////////////////////////////////////////// 39 | // 40 | // IOKit notification callbacks 41 | // 42 | /////////////////////////////////////////////////////////////// 43 | 44 | static void BlockDeviceChanged(void *ref, io_iterator_t iterator) { 45 | 46 | if (ref) [(__bridge MenuMeterDiskIO *)ref blockDeviceChanged:iterator]; 47 | 48 | } // BlockDeviceChanged 49 | 50 | 51 | /////////////////////////////////////////////////////////////// 52 | // 53 | // init/dealloc 54 | // 55 | /////////////////////////////////////////////////////////////// 56 | 57 | @implementation MenuMeterDiskIO 58 | 59 | - (id)init { 60 | 61 | self = [super init]; 62 | if (!self) { 63 | return nil; 64 | } 65 | 66 | // Connect to IOKit and setup our notification source 67 | kern_return_t err = IOMasterPort(MACH_PORT_NULL, &masterPort); 68 | if ((err != KERN_SUCCESS) || !masterPort) { 69 | return nil; 70 | } 71 | notifyPort = IONotificationPortCreate(masterPort); 72 | if (!notifyPort) { 73 | return nil; 74 | } 75 | notifyRunSource = IONotificationPortGetRunLoopSource(notifyPort); 76 | if (!notifyRunSource) { 77 | return nil; 78 | } 79 | CFRunLoopAddSource(CFRunLoopGetCurrent(), notifyRunSource, kCFRunLoopDefaultMode); 80 | 81 | // Install notifications for block storage devices 82 | err = IOServiceAddMatchingNotification(notifyPort, kIOPublishNotification, 83 | IOServiceMatching(kIOBlockStorageDriverClass), 84 | BlockDeviceChanged, (__bridge void *)(self), &blockDevicePublishedIterator); 85 | if (err != KERN_SUCCESS) { 86 | return nil; 87 | } 88 | err = IOServiceAddMatchingNotification(notifyPort, kIOTerminatedNotification, 89 | IOServiceMatching(kIOBlockStorageDriverClass), 90 | BlockDeviceChanged, (__bridge void *)(self), &blockDeviceTerminatedIterator); 91 | if (err != KERN_SUCCESS) { 92 | return nil; 93 | } 94 | 95 | // Pump both iterators 96 | BlockDeviceChanged((__bridge void *)(self), blockDevicePublishedIterator); 97 | BlockDeviceChanged((__bridge void *)(self), blockDeviceTerminatedIterator); 98 | 99 | // Seed our data 100 | [self diskIOActivity]; 101 | 102 | return self; 103 | 104 | } // init 105 | 106 | - (void)dealloc { 107 | 108 | if (blockDeviceIterator) IOObjectRelease(blockDeviceIterator); 109 | if (blockDevicePublishedIterator) IOObjectRelease(blockDevicePublishedIterator); 110 | if (blockDeviceTerminatedIterator) IOObjectRelease(blockDeviceTerminatedIterator); 111 | if (notifyRunSource) { 112 | CFRunLoopRemoveSource(CFRunLoopGetCurrent(), notifyRunSource, kCFRunLoopDefaultMode); 113 | } 114 | if (notifyPort) IONotificationPortDestroy(notifyPort); 115 | if (masterPort) mach_port_deallocate(mach_task_self(), masterPort); 116 | 117 | } // dealloc 118 | 119 | /////////////////////////////////////////////////////////////// 120 | // 121 | // Disk activity 122 | // 123 | /////////////////////////////////////////////////////////////// 124 | 125 | - (DiskIOActivityType)diskIOActivity { 126 | 127 | // Check that the iterator is still good, if not get a new one 128 | if (!blockDeviceIterator) { 129 | kern_return_t err = IOServiceGetMatchingServices(masterPort, 130 | IOServiceMatching(kIOBlockStorageDriverClass), 131 | &blockDeviceIterator); 132 | if (err != KERN_SUCCESS) { 133 | return kDiskActivityIdle; // Best we can do 134 | } 135 | } 136 | 137 | // Iterate the device list from IOKit and figure out if we're reading 138 | // or writing 139 | io_registry_entry_t driveEntry = MACH_PORT_NULL; 140 | uint64_t totalRead = 0, totalWrite = 0; 141 | while ((driveEntry = IOIteratorNext(blockDeviceIterator))) { 142 | 143 | // Get the statistics for this drive 144 | NSDictionary* statistics = CFBridgingRelease(IORegistryEntryCreateCFProperty(driveEntry, 145 | CFSTR(kIOBlockStorageDriverStatisticsKey), 146 | kCFAllocatorDefault, 147 | kNilOptions)); 148 | // If we got the statistics block for this device then we can add it to our totals 149 | if (statistics) { 150 | // Get total bytes read 151 | NSNumber *statNumber = (NSNumber *)[statistics objectForKey: 152 | (NSString *)CFSTR(kIOBlockStorageDriverStatisticsBytesReadKey)]; 153 | if (statNumber) { 154 | totalRead += [statNumber unsignedLongLongValue]; 155 | } 156 | // Bytes written 157 | statNumber = (NSNumber *)[statistics objectForKey: 158 | (NSString *)CFSTR(kIOBlockStorageDriverStatisticsBytesWrittenKey)]; 159 | if (statNumber) { 160 | totalWrite += [statNumber unsignedLongLongValue]; 161 | } 162 | } // end of statistics read 163 | 164 | // Release the drive 165 | if (driveEntry) { 166 | IOObjectRelease(driveEntry); 167 | } 168 | 169 | } // end of IOKit drive iteration 170 | 171 | // Reset our drive list 172 | IOIteratorReset(blockDeviceIterator); 173 | 174 | // Once we have totals all we care is if they changed. Calculating actualy 175 | // delta isn't important, since unmounts and overflows will change the 176 | // values. We're basically assuming that unmount == read/write, but 177 | // close enough. 178 | DiskIOActivityType activity = kDiskActivityIdle; 179 | if ((totalRead != previousTotalRead) && (totalWrite != previousTotalWrite)) { 180 | activity = kDiskActivityReadWrite; 181 | } else if (totalRead != previousTotalRead) { 182 | activity = kDiskActivityRead; 183 | } else if (totalWrite != previousTotalWrite) { 184 | activity = kDiskActivityWrite; 185 | } 186 | previousTotalRead = totalRead; 187 | previousTotalWrite = totalWrite; 188 | return activity; 189 | 190 | } // diskIOActivity 191 | 192 | /////////////////////////////////////////////////////////////// 193 | // 194 | // Device state changes 195 | // 196 | /////////////////////////////////////////////////////////////// 197 | 198 | -(void)blockDeviceChanged:(io_iterator_t)iterator { 199 | 200 | // Remove the current drive iterator, forcing its recreation later 201 | if (blockDeviceIterator) IOObjectRelease(blockDeviceIterator); 202 | blockDeviceIterator = MACH_PORT_NULL; 203 | 204 | // Drain the iterator 205 | io_service_t someDevice = IOIteratorNext(iterator); 206 | while (someDevice) { 207 | IOObjectRelease(someDevice); 208 | someDevice = IOIteratorNext(iterator); 209 | } 210 | 211 | } // _blockDeviceChanged: 212 | 213 | @end 214 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterDisk/MenuMeterDiskSpace.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterDiskSpace.h 3 | // 4 | // Reader object for disk space statistics 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import "LocalizedStrings.h" 31 | 32 | @interface MenuMeterDiskSpace : NSObject { 33 | 34 | // NSFormatter for disk space localization 35 | NSNumberFormatter *spaceFormatter; 36 | BOOL useBaseTen; 37 | 38 | } // MenuMeterDiskSpace 39 | 40 | // Disk space info 41 | - (NSMutableArray *)diskSpaceData; 42 | - (void)setBaseTen:(BOOL)baseTen; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterMem/MenuMeterMemExtra.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterMemExtra.h 3 | // 4 | // Menu Extra implementation 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import "MenuMeters.h" 27 | #import "MenuMeterDefaults.h" 28 | #import "MenuMeterMem.h" 29 | #import "MenuMeterMemStats.h" 30 | #import "MenuMeterWorkarounds.h" 31 | 32 | 33 | @interface MenuMeterMemExtra : NSMenuExtra { 34 | 35 | // Menu Extra necessities 36 | NSMenu *extraMenu; 37 | // Pref object 38 | MenuMeterDefaults *ourPrefs; 39 | // Info gathers 40 | MenuMeterMemStats *memStats; 41 | // Formatters for numbers so we get localization correctly 42 | NSNumberFormatter *memFloatMBFormatter, 43 | *memIntMBFormatter, 44 | *prettyIntFormatter, 45 | *percentFormatter; 46 | // Colors 47 | NSColor *freeColor, *usedColor, 48 | *activeColor, *inactiveColor, *wireColor, *compressedColor, 49 | *pageInColor, *pageOutColor; 50 | // Image cache for numbers label 51 | CGFloat numberLabelWidth; 52 | // Width of the text display 53 | float textWidth; 54 | // History data 55 | NSMutableArray *memHistory; 56 | NSDictionary *currentSwapStats; 57 | // Theme support 58 | NSColor *fgMenuThemeColor; 59 | 60 | } // MenuMeterMemExtra 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterMem/MenuMeterMemStats.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterMemStats.h 3 | // 4 | // Reader object for VM info 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import "MenuMeterWorkarounds.h" 32 | 33 | 34 | @interface MenuMeterMemStats : NSObject { 35 | 36 | // Mach host 37 | mach_port_t selfHost; 38 | // Total RAM 39 | uint64_t totalRAM; 40 | // Tiger or later? 41 | BOOL isTigerOrLater; 42 | // Mavericks or later? 43 | BOOL isMavericksOrLater; 44 | // Path to swap 45 | NSString *swapPath; 46 | // Swap name prefix 47 | NSString *swapPrefix; 48 | // Max swap count 49 | uint32_t peakSwapFiles; 50 | // Last paging counts 51 | uint64_t lastPageIn, lastPageOut; 52 | 53 | } // MenuMeterMemStats 54 | 55 | // Mem usage info 56 | - (NSDictionary *)memStats; 57 | - (NSDictionary *)swapStats; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterNet/MenuMeterNetConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterNetConfig.h 3 | // 4 | // Reader object for network config info 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import "MenuMeterNet.h" 32 | #import "MenuMeterNetPPP.h" 33 | 34 | 35 | @interface MenuMeterNetConfig : NSObject { 36 | 37 | // PPP data pull 38 | MenuMeterNetPPP *pppGatherer; 39 | // Values for SystemConfiguration sessions 40 | SCDynamicStoreRef scSession; 41 | CFRunLoopSourceRef scRunSource; 42 | // Mach port for IOKit 43 | mach_port_t masterPort; 44 | // Caches of current data 45 | NSArray *cachedInterfaceDetails; 46 | NSString *cachedPrimaryName; 47 | NSString *cachedPrimaryService; 48 | NSMutableDictionary *cachedServiceToName; 49 | NSMutableDictionary *cachedNameToService; 50 | NSMutableDictionary *cachedServiceSpeed; 51 | NSMutableDictionary *cachedUnderlyingInterface; 52 | NSMutableDictionary *cachedInterfaceUp; 53 | 54 | } // MenuMeterNetConfig 55 | 56 | // Network config info 57 | - (NSString *)computerName; 58 | - (NSDictionary *)interfaceConfigForInterfaceName:(NSString *)name; 59 | - (NSArray *)interfaceDetails; 60 | - (NSString *)primaryInterfaceName; 61 | - (NSString *)primaryServiceID; 62 | - (NSString *)serviceForInterfaceName:(NSString *)interfaceName; 63 | - (NSString *)interfaceNameForServiceID:(NSString *)serviceID; 64 | - (NSNumber *)speedForServiceID:(NSString *)serviceID; 65 | - (NSString *)underlyingInterfaceNameForServiceID:(NSString *)serviceID; 66 | - (BOOL)interfaceNameIsUp:(NSString *)interfaceName; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterNet/MenuMeterNetExtra.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterNetExtra.h 3 | // 4 | // Menu Extra implementation 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import "MenuMeters.h" 27 | #import "MenuMeterDefaults.h" 28 | #import "MenuMeterNet.h" 29 | #import "MenuMeterNetConfig.h" 30 | #import "MenuMeterNetStats.h" 31 | #import "MenuMeterNetPPP.h" 32 | #import "MenuMeterWorkarounds.h" 33 | 34 | 35 | @interface MenuMeterNetExtra : NSMenuExtra { 36 | 37 | // Menu Extra necessities 38 | NSMenu *extraMenu; 39 | // Pref object 40 | MenuMeterDefaults *ourPrefs; 41 | // Info gatherers/controllers 42 | MenuMeterNetConfig *netConfig; 43 | MenuMeterNetStats *netStats; 44 | MenuMeterNetPPP *pppControl; 45 | // Formatters for localization 46 | NSNumberFormatter *bytesFormatter, *prettyIntFormatter; 47 | // Cached colors 48 | NSColor *txColor, *rxColor, *inactiveColor; 49 | // Cached bezier paths 50 | NSBezierPath *upArrow, *downArrow; 51 | // Cached prerendered text 52 | CGFloat throughputLabelWidth; 53 | // Historical data samples and current interface config 54 | NSDate *lastSampleDate; 55 | NSMutableArray *netHistoryData, *netHistoryIntervals; 56 | NSDictionary *preferredInterfaceConfig; 57 | // Cached dictionary of menu items that can be updated 58 | NSMutableDictionary *updateMenuItems; 59 | NSFont *throughputFont; 60 | 61 | } // MenuMeterNetExtra 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterNet/MenuMeterNetPPP.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterNetPPP.h 3 | // 4 | // Talk to pppconfd 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | 30 | // PPP state machine from Apple PPPLib 31 | enum { 32 | PPP_IDLE = 0, 33 | PPP_INITIALIZE, 34 | PPP_CONNECTLINK, 35 | PPP_STATERESERVED, 36 | PPP_ESTABLISH, 37 | PPP_AUTHENTICATE, 38 | PPP_CALLBACK, 39 | PPP_NETWORK, 40 | PPP_RUNNING, 41 | PPP_TERMINATE, 42 | PPP_DISCONNECTLINK, 43 | PPP_HOLDOFF, 44 | PPP_ONHOLD, 45 | PPP_WAITONBUSY 46 | }; 47 | 48 | 49 | @interface MenuMeterNetPPP : NSObject { 50 | 51 | int pppconfdSocket; 52 | NSFileHandle *pppconfdHandle; 53 | 54 | } // MenuMeterNetPPP 55 | 56 | // Singleton 57 | + (id)sharedPPP; 58 | 59 | // PPP status 60 | - (NSDictionary *)statusForInterfaceName:(NSString *)ifname; 61 | - (NSDictionary *)statusForServiceID:(NSString *)serviceID; 62 | 63 | // PPP control 64 | - (void)connectServiceID:(NSString *)serviceID; 65 | - (void)disconnectServiceID:(NSString *)serviceID; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /MenuExtras/MenuMeterNet/MenuMeterNetStats.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeterNetStats.h 3 | // 4 | // Reader object for network throughput info 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import "MenuMeterNetPPP.h" 34 | 35 | @interface MenuMeterNetStats : NSObject { 36 | 37 | // Old data for containing prior reads 38 | NSMutableDictionary *lastData; 39 | // Buffer we keep around 40 | size_t sysctlBufferSize; 41 | uint8_t *sysctlBuffer; 42 | // PPP data 43 | MenuMeterNetPPP *pppGatherer; 44 | 45 | } // MenuMeterNetStats 46 | 47 | // Net usage info 48 | - (NSDictionary *)netStatsForInterval:(NSTimeInterval)sampleInterval; 49 | - (void)resetTotalsForInterfaceName:(NSString*)interfaceName; 50 | @end 51 | -------------------------------------------------------------------------------- /MenuMeters-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleGetInfoString 10 | MM_COPYRIGHT 11 | CFBundleIconFile 12 | MenuMeters.icns 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | MM_VERSION 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | MM_VERSION 27 | LSApplicationCategoryType 28 | public.app-category.utilities 29 | LSMinimumSystemVersion 30 | $(MACOSX_DEPLOYMENT_TARGET) 31 | LSUIElement 32 | 33 | NSAppleEventsUsageDescription 34 | This is to control the Activity Monitor to open specific panes such as memory or network. Another alert might be shown soon afterwards. 35 | NSMainNibFile 36 | MenuMetersMainMenu 37 | NSPrincipalClass 38 | NSApplication 39 | SUEnableAutomaticChecks 40 | 41 | SUPublicDSAKeyFile 42 | dsa_pub.pem 43 | SUScheduledCheckInterval 44 | 36000 45 | SUSendProfileInfo 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /MenuMeters.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.automation.apple-events 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MenuMeters.pch: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMeters.pch 3 | // 4 | // Prefix header for MenuMeters 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #ifdef __OBJC__ 25 | #import 26 | #import 27 | #import 28 | #endif 29 | 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/project.xcworkspace/xcshareddata/MenuMeters.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | D399AC01-C273-49D6-BBBD-6C6CD787F3C7 9 | IDESourceControlProjectName 10 | MenuMeters 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 60B401BB920FC106298BB3249272E41401DA781C 14 | https://github.com/yujitach/MenuMeters.git 15 | 16 | IDESourceControlProjectPath 17 | MenuMeters.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 60B401BB920FC106298BB3249272E41401DA781C 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/yujitach/MenuMeters.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 60B401BB920FC106298BB3249272E41401DA781C 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 60B401BB920FC106298BB3249272E41401DA781C 36 | IDESourceControlWCCName 37 | MenuMeters 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/xcshareddata/xcschemes/MenuMeters No Sparkle.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /MenuMeters.xcodeproj/xcshareddata/xcschemes/MenuMeters.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /MenuMetersApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MenuMetersApp 4 | // 5 | // Created by Yuji on 2015/07/30. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MenuMetersApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MenuMetersApp 4 | // 5 | // Created by Yuji on 2015/07/30. 6 | // 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MenuMeterCPUExtra.h" 11 | #import "MenuMeterDiskExtra.h" 12 | #import "MenuMeterMemExtra.h" 13 | #import "MenuMeterNetExtra.h" 14 | #import "MenuMetersPref.h" 15 | #ifdef SPARKLE 16 | #import 17 | #endif 18 | 19 | @interface AppDelegate () 20 | 21 | @property (weak) IBOutlet NSWindow *window; 22 | @end 23 | 24 | @implementation AppDelegate 25 | { 26 | MenuMeterCPUExtra*cpuExtra; 27 | MenuMeterDiskExtra*diskExtra; 28 | MenuMeterNetExtra*netExtra; 29 | MenuMeterMemExtra*memExtra; 30 | MenuMetersPref*pref; 31 | #ifdef SPARKLE 32 | SUUpdater*updater; 33 | #endif 34 | NSTimer*timer; 35 | } 36 | 37 | -(IBAction)checkForUpdates:(id)sender 38 | { 39 | #ifdef SPARKLE 40 | [updater checkForUpdates:sender]; 41 | #endif 42 | } 43 | 44 | -(void)killOlderInstances{ 45 | NSString*thisVersion=NSBundle.mainBundle.infoDictionary[@"CFBundleVersion"]; 46 | for(NSRunningApplication* x in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.yujitach.MenuMeters"]){ 47 | if([x isEqualTo:NSRunningApplication.currentApplication]){ 48 | continue; 49 | } 50 | NSBundle*b=[NSBundle bundleWithURL:x.bundleURL]; 51 | NSString*version=b.infoDictionary[@"CFBundleVersion"]; 52 | #ifdef SPARKLE 53 | NSComparisonResult r=[[SUStandardVersionComparator defaultComparator] compareVersion:version toVersion:thisVersion]; 54 | #else 55 | NSComparisonResult r=[version compare:thisVersion options:NSNumericSearch]; 56 | #endif 57 | NSLog(@"vers: running is %@, ours is %@, compare result was %ld", version, thisVersion, r); 58 | if(r!=NSOrderedDescending){ 59 | NSLog(@"version %@ already running, which is equal or older than this binary %@. Going to kill it.",version,thisVersion); 60 | [x terminate]; 61 | } 62 | } 63 | } 64 | - (void)applicationWillFinishLaunching:(NSNotification *)notification 65 | { 66 | [MenuMeterDefaults movePreferencesIfNecessary]; 67 | } 68 | #define WELCOME @"v2.0.8alert" 69 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 70 | // Insert code here to initialize your application 71 | [NSColor setIgnoresAlpha:NO]; 72 | if([self isRunningOnReadOnlyVolume]){ 73 | [self alertConcerningAppTranslocation]; 74 | } 75 | [self killOlderInstances]; 76 | #ifdef SPARKLE 77 | updater=[SUUpdater sharedUpdater]; 78 | updater.feedURL=[NSURL URLWithString:@"https://member.ipmu.jp/yuji.tachikawa/MenuMetersElCapitan/MenuMeters-Update.xml"]; 79 | pref=[[MenuMetersPref alloc] initWithAboutFileName:WELCOME andUpdater:updater]; 80 | #else 81 | pref=[[MenuMetersPref alloc] initWithAboutFileName:WELCOME]; 82 | #endif 83 | NSString*key=[WELCOME stringByAppendingString:@"Presented"]; 84 | if(![[NSUserDefaults standardUserDefaults] boolForKey:key]){ 85 | [pref openAbout:WELCOME]; 86 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:key]; 87 | } 88 | // init of extras were moved to the last step. 89 | // It is because init of extras can raise exceptions when I introduce bugs. 90 | // If extras are init'ed first, neither the updater nor the pref pane is init'ed, 91 | // which is even worse. 92 | // When extras are inited last, at least the updater and the pref pane are live. 93 | cpuExtra=[[MenuMeterCPUExtra alloc] init]; 94 | diskExtra=[[MenuMeterDiskExtra alloc] init]; 95 | netExtra=[[MenuMeterNetExtra alloc] init]; 96 | memExtra=[[MenuMeterMemExtra alloc] init]; 97 | } 98 | 99 | 100 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 101 | // Insert code here to tear down your application 102 | } 103 | 104 | 105 | - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag 106 | { 107 | [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; 108 | [pref.window makeKeyAndOrderFront:sender]; 109 | return YES; 110 | } 111 | 112 | 113 | - (BOOL)isRunningOnReadOnlyVolume { 114 | // taken from https://github.com/Squirrel/Squirrel.Mac/pull/186/files 115 | struct statfs statfsInfo; 116 | NSURL *bundleURL = NSRunningApplication.currentApplication.bundleURL; 117 | int result = statfs(bundleURL.fileSystemRepresentation, &statfsInfo); 118 | if (result == 0) { 119 | return (statfsInfo.f_flags & MNT_RDONLY) != 0; 120 | } else { 121 | // If we can't even check if the volume is read-only, assume it is. 122 | return YES; 123 | } 124 | } 125 | 126 | -(void)alertConcerningAppTranslocation{ 127 | NSAlert*alert=[[NSAlert alloc] init]; 128 | alert.messageText=@"Please move the app after downloading it"; 129 | [alert addButtonWithTitle:@"OK, I quit the app and move it"]; 130 | alert.informativeText=@"Please move the app to, say, /Applications, using your mouse/trackpad, not from the command line. \n\nApple decided that they don't allow the app to auto-update otherwise. \n\nI am sorry for the inconvenience."; 131 | [alert runModal]; 132 | [NSApp terminate:nil]; 133 | } 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /MenuMetersApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "128x128", 25 | "idiom" : "mac", 26 | "filename" : "foo.png", 27 | "scale" : "1x" 28 | }, 29 | { 30 | "idiom" : "mac", 31 | "size" : "128x128", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "size" : "256x256", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "idiom" : "mac", 41 | "size" : "256x256", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "idiom" : "mac", 46 | "size" : "512x512", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "idiom" : "mac", 51 | "size" : "512x512", 52 | "scale" : "2x" 53 | } 54 | ], 55 | "info" : { 56 | "version" : 1, 57 | "author" : "xcode" 58 | } 59 | } -------------------------------------------------------------------------------- /MenuMetersApp/Assets.xcassets/AppIcon.appiconset/foo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuMetersApp/Assets.xcassets/AppIcon.appiconset/foo.png -------------------------------------------------------------------------------- /MenuMetersApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleGetInfoString 12 | MM_COPYRIGHT 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | MM_VERSION 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSMinimumSystemVersion 28 | $(MACOSX_DEPLOYMENT_TARGET) 29 | LSUIElement 30 | 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /MenuMetersApp/MenuMeters.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/MenuMetersApp/MenuMeters.icns -------------------------------------------------------------------------------- /MenuMetersApp/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Open MenuMeters preferences" = "MenuMeters Einstellungen öffnen"; 2 | // Processor title menu item (second title is used on multi-CPU systems) 3 | "Processor:" = "Prozessor:"; 4 | "Processors:" = "Prozessoren:"; 5 | 6 | // And the format string for the processor menu display (ex: "1 PowerPC 7450 @ 800MHz") 7 | // Note that CPU name information ("PowerPC 7450") cannot be localized, it is 8 | // provided by the system 9 | "%u %@ @ %@" = "%1$u %2$@ @ %3$@"; 10 | 11 | // Uptime title menu item 12 | "Uptime:" = "Laufzeit:"; 13 | 14 | // Uptime error (unavailable) 15 | "Unavailable" = "Nicht verfügbar"; 16 | 17 | // Format strings for uptime (ex: "2 days 08:16:32") 18 | // Multiple day format 19 | "%ld days %02ld:%02ld:%02ld" = "%1$ld Tage %2$02ld:%3$02ld:%4$02ld Std."; 20 | // Single day format 21 | "%ld day %02ld:%02ld:%02ld" = "%1$ld Tag %2$02ld:%3$02ld:%4$02ld Std."; 22 | // Less than one day format 23 | "%02ld:%02ld:%02ld" = "%1$02ld:%2$02ld:%3$02ld"; 24 | 25 | // Tasks and threads title 26 | "Tasks/Threads:" = "Prozesse/Threads:"; 27 | 28 | // Format strings for tasks and threads 29 | "%d tasks, %d threads" = "%1$d Prozesse, %2$d Threads"; 30 | 31 | // Core count / hyperthreading format strings 32 | " (%@ hyperthreads per core)" = " (%@ hyperthreads per core)"; 33 | "%@%@ physical cores" = "%@%@ physical cores"; 34 | 35 | // Load average title 36 | "Load Average (1m, 5m, 15m):" = "Durchschnittliche Auslastung (1 Min., 5 Min., 15 Min.):"; 37 | 38 | // Load average format 39 | // Note that this only applies to the format of the string as a whole, not 40 | // the format of the load average floats themselves (load average floats are 41 | // automatically localized by NSNumberFormatter) 42 | "%@, %@, %@" = "%1$@, %2$@, %3$@"; 43 | 44 | // Open Process Viewer/Open Console 45 | "Open Process Viewer" = "Prozess-Monitor öffnen"; 46 | "Open Activity Monitor" = "Aktivitätsanzeige öffnen"; 47 | "Open Console" = "Konsole öffnen"; 48 | 49 | // Miscellaneous error strings 50 | 51 | // Displayed when CPU load, load average, or task count fails to return info 52 | "No info available" = "Nicht verfügbar"; 53 | // Strings used for disk space free/used/total labels 54 | // Note that the actual disk space float format is automatically localized 55 | // by an NSNumberFormatter. 56 | "%@ Used" = "%1$@ Benutzt"; 57 | "%@ Free" = "%1$@ Frei"; 58 | "%@ Total" = "%1$@ Gesamt"; 59 | 60 | // Unit labels 61 | "KB" = "KB"; 62 | "MB" = "MB"; 63 | "GB" = "GB"; 64 | 65 | // Menubar display labels used in free/total mode 66 | "U:" = "B:"; 67 | "F:" = "F:"; 68 | 69 | // Unit labels 70 | "MB" = "MB"; 71 | 72 | // Memory usage title menu item 73 | "Memory Usage:" = "Speicheraufteilung:"; 74 | 75 | // Format string for memory usage. Float conversion to X.XX is 76 | // automatically localized by NSNumberFormatter and is therefore not exposed 77 | "%@ used, %@ free, %@ total" = "%1$@ Benutzt, %2$@ Frei, %3$@ Gesamt"; 78 | 79 | // Memory page statistics title menu item 80 | "Memory Pages:" = "Speicherseiten:"; 81 | 82 | // Format strings for memory statistics. Float conversion to X.XX is 83 | // automatically localized by NSNumberFormatter and is therefore not exposed 84 | "%@ active, %@ wired" = "%1$@ Aktiv, %2$@ Reserviert"; 85 | "%@ inactive, %@ free" = "%1$@ Inaktiv, %2$@ Frei"; 86 | "%@ compressed (%@)" = "%1$@ komprimiert (%2$@)"; 87 | 88 | // VM statistics title menu item 89 | "VM Statistics:" = "VM-Statistiken:"; 90 | 91 | // Format strings for VM statistics 92 | // Technically we should cover all permutations of 1 or more than 1 93 | // for each statistic, but in the real world users never have just 94 | // one pagein or copy-on-write, etc. so we can simplify to just 95 | // the plural forms 96 | "%@ pageins, %@ pageouts" = "%1$@ gelesene Seiten, %2$@ geschriebene Seiten"; 97 | "%@ cache lookups, %@ cache hits (%@)" = "%1$@ Cache-Suchen, %2$@ Cache-Treffer (%3$@)"; 98 | "%@ page faults, %@ copy-on-writes" = "%1$@ Seitenfehler, %2$@ Kopien-nach-Schreiben"; 99 | 100 | // Swap file statistics title menu item 101 | "Swap Files:" = "Auslagerungsdateien:"; 102 | 103 | // Swap file info formats. Here we do need to handle plurals since 104 | // values of 1 are likely 105 | // Basic swap file info (ex: "1 swap file in /private/var/vm/") 106 | "%@ swap file present in %@" = "%1$@ Auslagerungsdatei in %2$@ vorhanden"; 107 | "%@ swap files present in %@" = "%1$@ Auslagerungsdateien in %2$@ vorhanden"; 108 | // Basic swap file info with encryption 109 | "%@ encrypted swap file present in %@" = "%1$@ verschlüsselte Auslagerungsdatei in %2$@ vorhanden"; 110 | "%@ encrypted swap files present in %@" = "%1$@ verschlüsselte Auslagerungsdateien in %2$@ vorhanden"; 111 | // Maximum swap count info 112 | "%@ swap file at peak usage" = "Maximal %1$@ Auslagerungsdatei benutzt"; 113 | "%@ swap files at peak usage" = "Maximal %1$@ Auslagerungsdateien benutzt"; 114 | // Swap space info, as with free/used/total the float format and MB label 115 | // are handled automatically by NSFormatter 116 | "%@ total swap space" = "Auslagerungsdateien belegen %1$@"; 117 | // Swap space including used info (Tiger only) 118 | "%@ total swap space (%@ used)" = "Auslagerungsdateien belegen %1$@ (%2$@ benutzt)"; 119 | // Menubar display labels for throughput, Tx and Rx also used for Tx and Rx menu items 120 | "Tx:" = "Tx:"; 121 | "Rx:" = "Rx:"; 122 | 123 | // Unit labels 124 | "Gbps" = "Gbps"; 125 | "Mbps" = "Mbps"; 126 | "Kbps" = "Kbps"; 127 | "B" = "B"; 128 | "KB" = "KB"; 129 | "MB" = "MB"; 130 | "GB" = "GB"; 131 | "B/s" = "B/s"; 132 | "KB/s" = "KB/s"; 133 | "MB/s" = "MB/s"; 134 | "GB/s" = "GB/s"; 135 | 136 | // PPP connection titles and states 137 | "PPP:" = "PPP:"; 138 | "Not Connected" = "Nicht verbunden"; 139 | "Connecting..." = "Verbindungsaufbau …"; 140 | "Connected" = "Verbunden"; 141 | "Connected %02d:%02d:%02d" = "Verbunden %1$02d:%2$02d:%3$02d"; 142 | "Disconnecting..." = "Verbindungsabbau …"; 143 | 144 | // TCP/IP menu titles 145 | "TCP/IP:" = "TCP/IP:"; 146 | "IPv4:" = "IPv4:"; 147 | "IPv6:" = "IPv6:"; 148 | 149 | // Label for inactive TCP/IP interfaces 150 | "Inactive" = "Inaktiv"; 151 | 152 | // AppleTalk menu title 153 | "AppleTalk:" = "AppleTalk:"; 154 | 155 | // Format string for AppleTalk display info 156 | "Net: %@ Node: %@ Zone: %@" = "Netz: %1$@ Knoten: %2$@ Zone: %3$@"; 157 | 158 | // Throughput menu title 159 | "Throughput:" = "Durchsatz:"; 160 | 161 | // Peak throughput menu title 162 | "Peak Throughput:" = "Spitzendurchsatz:"; 163 | 164 | // Traffic totals menu title 165 | "Traffic Totals:" = "Transfersummen:"; 166 | 167 | // Traffic total format string. The Tx and Rx labels from above are automatically used 168 | // as the first param, and numbers are localized automatically by NSNumberFormatter 169 | // ex: "Tx: XX.XMB (XXX,XXX bytes) 170 | "%@ %@ (%@ bytes)" = "%1$@ %2$@ (%3$@ Bytes)"; 171 | 172 | // Menu action title strings 173 | "Open Network Utility" = "Netzwerk-Dienstprogramm öffnen"; 174 | "Open Network Preferences" = "Netzwerkeinstellungen öffnen"; 175 | "Open Internet Connect" = "Internet-Verbindung öffnen"; 176 | "Display primary interface" = "Primäre Netzwerkschnittstelle anzeigen"; 177 | "Display this interface" = "Diese Netzwerkschnittstelle anzeigen"; 178 | "Copy IPv4 address" = "IPv4-Adresse kopieren"; 179 | "Copy IPv6 address" = "IPv6-Adresse kopieren"; 180 | "Connect" = "Verbindung Aufbauen"; 181 | "Disconnect" = "Verbindung Trennen"; 182 | 183 | // Miscellaneous error strings 184 | "No Active Interfaces" = "Keine aktiven Schnittstellen"; 185 | -------------------------------------------------------------------------------- /MenuMetersApp/dsa_pub.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQC0HuYHDdfmE7no0J0a09VgNli6/oZD 3 | D7iXk8fszmkTEiFYbppncATDaZ6LSXwC58CaKBomLA5IpYrGm2do0p07kvKT/2GK 4 | 0D+VKwnPI8cmbDxnXDbGdVyeBTz1m4Pkn3O4Q1ySc4DRmRTj6wOKBkwM5UyXgGX4 5 | P5h8yiTfSVYCP/kJquEwqYkG3WJZGAF9e5NkFTjOfXmrDJKi3KPwfvx41ukmsiy6 6 | 7A6GmDBlbIzWlVz6lme1LOrlVzEKuAsz4GOZjRu26jPUuCB+PfKiSz9hlsBNFvAg 7 | O0nUC6/nPs/PSx4XmSSiZ9WJ63MEv9lRwseVp9Aq+Kz57ow7HZm/I/x3AhUA+Voz 8 | PAwLyzciPRwgQ+tWYc8QSWMCggEALJzgRAnzC4U3YgXJXgLFEgv2BIA74Nc8xO39 9 | O3iKG1bS0L4OdPE2cojmxM8qJU6+DDjb8lb3JVjHdaTdd3BPaPo9OI7uNuHfdHI8 10 | C+7oaREYvpBLoTA4wXf5XsUwrsF/HHvuhoBE3k3yUaUpSEyWf7Yp2o+LwwSyusyo 11 | aYKdzWPtKoXVW55njh0UbQGYAxCcS6a7Dwn3v52Z42jZoUP69sR4qsgQFJyCZ3+D 12 | 7+ju1bOlghI3r92V2ulY5Z5sKD0Pj7WZ+1zPrCbOCWZt3tk5sIic9E/r9zD+NkHJ 13 | hEphglyyvjKIWbScwATGqbwp2NggzyNb1H4uRmkvLS08iIEDdQOCAQUAAoIBAG1z 14 | pbeV4rNsaD41K/SJE0Wkpyu9pdbYHLgfdH1gEm6HTboVfj4gzpSh7VxC1AyMWmW5 15 | Xwri+iCJ3R1i3AMHELY8P6Sw7GUUlfrNRjz96V1nlDVh+bTR5EXW7mDo9n3ea400 16 | E0bIxvwsjBjHSMwbq44O1meF5X8bH78uX2sK0w5lFpR4bVfPCScrdsm/kRlJVDdk 17 | 4CghqkZrM35vneBoj+oS5zSJEp2SXgMKiDFu7nCTiWtJq8o6/xgpnchEzX46+mCA 18 | RBHNwGNcWY67oAuQ9Djw23bqgmuptZ/lPXyoclWZnHGCF65JY5SdPR31rqlZ+NX+ 19 | s60GWcrmrT2FOjmdLBw= 20 | -----END PUBLIC KEY----- 21 | -------------------------------------------------------------------------------- /MenuMetersApp/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | // Processor title menu item (second title is used on multi-CPU systems) 2 | "Processor:" = "Processeur :"; 3 | "Processors:" = "Processeurs :"; 4 | 5 | // And the format string for the processor menu display (ex: "1 PowerPC 7450 @ 800MHz") 6 | // Note that CPU name information ("PowerPC 7450") cannot be localized, it is 7 | // provided by the system 8 | "%u %@ @ %@" = "%1$u %2$@ @ %3$@"; 9 | 10 | // Uptime title menu item 11 | "Uptime:" = "Uptime :"; 12 | 13 | // Uptime error (unavailable) 14 | "Unavailable" = "Indisponible"; 15 | 16 | // Multiple day format 17 | "%ld days %02ld:%02ld:%02ld" = "%1$ld jours %2$02ld:%3$02ld:%4$02ld"; 18 | // Single day format 19 | "%ld day %02ld:%02ld:%02ld" = "%1$ld jour %2$02ld:%3$02ld:%4$02ld"; 20 | // Less than one day format 21 | "%02ld:%02ld:%02ld" = "%1$02ld:%2$02ld:%3$02ld"; 22 | 23 | // Tasks and threads title 24 | "Tasks/Threads:" = "Tâches/Fils :"; 25 | 26 | // Format strings for tasks and threads 27 | "%d tasks, %d threads" = "%1$d tâches, %2$d fils"; 28 | 29 | // Core count / hyperthreading format strings 30 | " (%@ hyperthreads per core)" = " (%@ hyperthreads per core)"; 31 | "%@%@ physical cores" = "%@%@ physical cores"; 32 | 33 | // Load average title 34 | "Load Average (1m, 5m, 15m):" = "Charge moyenne (1m, 5m, 15m) :"; 35 | 36 | // Load average format 37 | // Note that this only applies to the format of the string as a whole, not 38 | // the format of the load average floats themselves (load average floats are 39 | // automatically localized by NSNumberFormatter) 40 | "%@, %@, %@" = "%1$@, %2$@, %3$@"; 41 | 42 | // Open Process Viewer/Open Console 43 | "Open Process Viewer" = "Ouvrir Visualiseur d'opérations"; 44 | "Open Activity Monitor" = "Ouvrir Moniteur d'activité"; 45 | "Open Console" = "Ouvrir Console"; 46 | 47 | // Miscellaneous error strings 48 | 49 | // Displayed when CPU load, load average, or task count fails to return info 50 | "No info available" = "Aucune info disponible"; 51 | // Strings used for disk space free/used/total labels 52 | // Note that the actual disk space float format is automatically localized 53 | // by an NSNumberFormatter. 54 | "%@ Used" = "%1$@ Utilisé(s)"; 55 | "%@ Free" = "%1$@ Disponible(s)"; 56 | "%@ Total" = "Total de %1$@"; 57 | 58 | // Unit labels 59 | "KB" = "Ko"; 60 | "MB" = "Mo"; 61 | "GB" = "Go"; 62 | 63 | 64 | // Menubar display labels used in free/total mode 65 | "U:" = "U:"; 66 | "F:" = "L:"; 67 | 68 | // Unit labels 69 | "MB" = "Mo"; 70 | 71 | // Memory usage title menu item 72 | "Memory Usage:" = "Utilisation mémoire :"; 73 | 74 | // Format string for memory usage. Float conversion to X.XX is 75 | // automatically localized by NSNumberFormatter and is therefore not exposed 76 | "%@ used, %@ free, %@ total" = "%1$@ utilisé, %2$@ disponible, total de %3$@"; 77 | 78 | // Memory page statistics title menu item 79 | "Memory Pages:" = "Utilisation mémoire détaillée :"; 80 | 81 | // Format strings for memory statistics. Float conversion to X.XX is 82 | // automatically localized by NSNumberFormatter and is therefore not exposed 83 | "%@ active, %@ wired" = "%1$@ actif, %2$@ lié"; 84 | "%@ inactive, %@ free" = "%1$@ inactif, %2$@ libre"; 85 | "%@ compressed (%@)" = "%1$@ compressé(s) (%2$@)"; 86 | 87 | // VM statistics title menu item 88 | "VM Statistics:" = "Mémoire virtuelle et Caches :"; 89 | 90 | // Format strings for VM statistics 91 | // Technically we should cover all permutations of 1 or more than 1 92 | // for each statistic, but in the real world users never have just 93 | // one pagein or copy-on-write, etc. so we can simplify to just 94 | // the plural forms 95 | "%@ pageins, %@ pageouts" = "%1$@ pageins, %2$@ pageouts"; 96 | "%@ cache lookups, %@ cache hits (%@)" = "%1$@ cache lookups, %2$@ cache hits (%3$@)"; 97 | "%@ page faults, %@ copy-on-writes" = "%1$@ page faults, %2$@ copy-on-writes"; 98 | 99 | // Swap file statistics title menu item 100 | "Swap Files:" = "Fichiers de swap :"; 101 | 102 | // Swap file info formats. Here we do need to handle plurals since 103 | // values of 1 are likely 104 | // Basic swap file info (ex: "1 swap file in /private/var/vm/") 105 | "%@ swap file present in %@" = "%1$@ fichier de swap dans %2$@"; 106 | "%@ swap files present in %@" = "%1$@ fichiers de swap dans %2$@"; 107 | // Basic swap file info with encryption 108 | "%@ encrypted swap file present in %@" = "%1$@ fichier de swap crypté dans %2$@"; 109 | "%@ encrypted swap files present in %@" = "%1$@ fichiers de swap cryptés dans %2$@"; 110 | // Maximum swap count info 111 | "%@ swap file at peak usage" = "%1$@ fichier utilisé lors d'un usage intensif"; 112 | "%@ swap files at peak usage" = "%1$@ fichiers utilisés lors d'un usage intensif"; 113 | // Swap space info, as with free/used/total the float format and MB label 114 | // are handled automatically by NSFormatter 115 | "%@ total swap space" = "Le swap fait actuellement %1$@"; 116 | // Swap space including used info (Tiger only) 117 | "%@ total swap space (%@ used)" = "Le swap total est de %1$@ (%2$@ utilisé)"; 118 | // Menubar display labels for throughput, Tx and Rx also used for Tx and Rx menu items 119 | "Tx:" = "Tx:"; 120 | "Rx:" = "Rx:"; 121 | 122 | // Unit labels 123 | "Gbps" = "Gbps"; 124 | "Mbps" = "Mbps"; 125 | "Kbps" = "Kbps"; 126 | "B" = "o"; 127 | "KB" = "Ko"; 128 | "MB" = "Mo"; 129 | "GB" = "Go"; 130 | "B/s" = "o/s"; 131 | "KB/s" = "Ko/s"; 132 | "MB/s" = "Mo/s"; 133 | "GB/s" = "Go/s"; 134 | 135 | // PPP connection titles and states 136 | "PPP:" = "PPP :"; 137 | "Not Connected" = "Déconnecté"; 138 | "Connecting..." = "Connexion..."; 139 | "Connected" = "Connecté"; 140 | "Connected %02d:%02d:%02d" = "Connecté depuis %1$02d:%2$02d:%3$02d"; 141 | "Disconnecting..." = "Déconnexion..."; 142 | 143 | // TCP/IP menu titles 144 | "TCP/IP:" = "TCP/IP :"; 145 | "IPv4:" = "IPv4 :"; 146 | "IPv6:" = "IPv6 :"; 147 | 148 | // Label for inactive TCP/IP interfaces 149 | "Inactive" = "Inactive"; 150 | 151 | // AppleTalk menu title 152 | "AppleTalk:" = "AppleTalk :"; 153 | 154 | // Format string for AppleTalk display info 155 | "Net: %@ Node: %@ Zone: %@" = "Net : %1$@ Nœud : %2$@ Zone : %3$@"; 156 | 157 | // Throughput menu title 158 | "Throughput:" = "Débit :"; 159 | 160 | // Peak throughput menu title 161 | "Peak Throughput:" = "Débit montant maximal :"; 162 | 163 | // Traffic totals menu title 164 | "Traffic Totals:" = "Trafic total :"; 165 | 166 | // Traffic total format string. The Tx and Rx labels from above are automatically used 167 | // as the first param, and numbers are localized automatically by NSNumberFormatter 168 | // ex: "Tx: XX.XMB (XXX,XXX bytes) 169 | "%@ %@ (%@ bytes)" = "%1$@ %2$@ (%3$@ octets)"; 170 | 171 | // Menu action title strings 172 | "Open MenuMeters preferences" = "Ouvrir les préférences MenuMeters"; 173 | "Open Network Utility" = "Ouvrir Utilitaire de réseau"; 174 | "Open Network Preferences" = "Ouvrir les préférences Réseau"; 175 | "Open Internet Connect" = "Ouvrir Connexion à Internet"; 176 | "Display this interface" = "Afficher cette interface"; 177 | "Display primary interface" = "Afficher l'interface primaire"; 178 | "Copy IPv4 address" = "Copier l'adresse IPv4"; 179 | "Copy IPv6 address" = "Copier l'adresse IPv6"; 180 | "Connect" = "Connexion"; 181 | "Disconnect" = "Déconnexion"; 182 | 183 | // Miscellaneous error strings 184 | "No Active Interfaces" = "Aucune interface active"; 185 | -------------------------------------------------------------------------------- /MenuMetersApp/generateLocalizableStrings.perl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | for $lang (<../MenuExtras/MenuMeterCPU/*.lproj>){ 3 | ($la)=($lang=~/([^\/]+)\.lproj/); 4 | mkdir "$la.lproj"; 5 | unlink "$la.lproj/Localizable.strings"; 6 | for $x(qw/CPU Disk Mem Net/){ 7 | system(qq(cat ../MenuExtras/MenuMeter$x/$la.lproj/Localizable.strings >> $la.lproj/Localizable.strings)); 8 | } 9 | } -------------------------------------------------------------------------------- /MenuMetersApp/ja.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Open MenuMeters preferences" = "MenuMeters 環境設定を開く"; 2 | 3 | // Processor title menu item (second title is used on multi-CPU systems) 4 | "Processor:" = "プロセッサ:"; 5 | "Processors:" = "プロセッサ:"; 6 | 7 | // And the format string for the processor menu display (ex: "1 PowerPC 7450 @ 800MHz") 8 | // Note that CPU name information ("PowerPC 7450") cannot be localized, it is 9 | // provided by the system 10 | "%u %@ @ %@" = "%1$u つの %2$@/%3$@"; 11 | 12 | // Uptime title menu item 13 | "Uptime:" = "稼働時間:"; 14 | 15 | // Uptime error (unavailable) 16 | "Unavailable" = "Unavailable"; 17 | 18 | // Format strings for uptime (ex: "2 days 08:16:32") 19 | // Multiple day format 20 | "%ld days %02ld:%02ld:%02ld" = "%1$ld 日 %2$02ld 時間 %3$02ld 分 %4$02ld 秒"; 21 | // Single day format 22 | "%ld day %02ld:%02ld:%02ld" = "%1$ld 日 %2$02ld 時間 %3$02ld 分 %4$02ld 秒"; 23 | // Less than one day format 24 | "%02ld:%02ld:%02ld" = "%1$02ld 時間 %3$02ld 分 %4$02ld 秒"; 25 | 26 | // Tasks and threads title 27 | "Tasks/Threads:" = "タスク/スレッド:"; 28 | 29 | // Format strings for tasks and threads 30 | "%d tasks, %d threads" = "タスク数:%1$d、スレッド数:%2$d"; 31 | 32 | // Core count / hyperthreading format strings 33 | " (%@ hyperthreads per core)" = " (1コアあたり %@ ハイパースレッド)"; 34 | "%@%@ physical cores" = "%@%@ 個の物理コア"; 35 | 36 | // Load average title 37 | "Load Average (1m, 5m, 15m):" = "平均負荷:"; 38 | 39 | // Load average format 40 | // Note that this only applies to the format of the string as a whole, not 41 | // the format of the load average floats themselves (load average floats are 42 | // automatically localized by NSNumberFormatter) 43 | "%@, %@, %@" = "1分間:%1$@、5分間:%2$@、15分間:%3$@"; 44 | // CPU power limit status 45 | "CPU power limit:" = "CPU パワーリミット:"; 46 | "speed %@%%, scheduler %@%%" = "スピード %@%%, スケジューラ %@%%"; 47 | // Open Process Viewer/Open Console 48 | "Open Process Viewer" = "プロセスビューアを開く"; 49 | "Open Activity Monitor" = "アクティビティモニタを開く"; 50 | "Open Console" = "コンソールを開く"; 51 | 52 | // Miscellaneous error strings 53 | 54 | // Displayed when CPU load, load average, or task count fails to return info 55 | "No info available" = "利用可能な情報がありません"; 56 | // Strings used for disk space free/used/total labels 57 | // Note that the actual disk space float format is automatically localized 58 | // by an NSNumberFormatter. 59 | "%@ Used" = "使用領域:%1$@、"; 60 | "%@ Free" = "空き領域:%1$@、"; 61 | "%@ Total" = "容量:%1$@"; 62 | 63 | // Unit labels 64 | "KB" = "KB"; 65 | "MB" = "MB"; 66 | "GB" = "GB"; 67 | "Memory Pressure:" = "メモリプレッシャー:"; 68 | "%@%%\t(level %@)" = "%@%%\t(レベル %@)"; 69 | 70 | // Menubar display labels used in free/total mode 71 | "U:" = "使用:"; 72 | "F:" = "空き:"; 73 | 74 | // Unit labels 75 | "MB" = "MB"; 76 | 77 | // Memory usage title menu item 78 | "Memory Usage:" = "メモリ使用:"; 79 | 80 | // Format string for memory usage. Float conversion to X.XX is 81 | // automatically localized by NSNumberFormatter and is therefore not exposed 82 | "%@ used, %@ free, %@ total" = "使用中:%1$@、空き:%2$@、合計:%3$@"; 83 | 84 | // Memory page statistics title menu item 85 | "Memory Pages:" = "メモリページ:"; 86 | 87 | // Format strings for memory statistics. Float conversion to X.XX is 88 | // automatically localized by NSNumberFormatter and is therefore not exposed 89 | "%@ active, %@ wired" = "現在使用中:%1$@、固定中:%2$@"; 90 | "%@ inactive, %@ free" = "現在非使用中:%1$@、空き:%2$@"; 91 | "%@ compressed (%@)" = "圧縮中:%1$@ (%2$@)"; 92 | 93 | // VM statistics title menu item 94 | "VM Statistics:" = "仮想メモリ:"; 95 | 96 | // Format strings for VM statistics 97 | // Technically we should cover all permutations of 1 or more than 1 98 | // for each statistic, but in the real world users never have just 99 | // one pagein or copy-on-write, etc. so we can simplify to just 100 | // the plural forms 101 | "%@ pageins, %@ pageouts" = "ページイン:%1$@、ページアウト:%2$@"; 102 | "%@ cache lookups, %@ cache hits (%@)" = "キャッシュルックアップ:%1$@、キャッシュヒット:%2$@ (%3$@)"; 103 | "%@ page faults, %@ copy-on-writes" = "ページフォールト:%1$@、コピーオンワイアー:%2$@"; 104 | 105 | // Swap file statistics title menu item 106 | "Swap Files:" = "スワップファイル:"; 107 | 108 | // Swap file info formats. Here we do need to handle plurals since 109 | // values of 1 are likely 110 | // Basic swap file info (ex: "1 swap file in /private/var/vm/") 111 | "%@ swap file present in %@" = "%1$@ つのスワップファイルを %2$@ で使用中"; 112 | "%@ swap files present in %@" = "%1$@ つのスワップファイルを %2$@ で使用中"; 113 | // Basic swap file info with encryption 114 | "%@ encrypted swap file present in %@" = "%1$@ つの暗号化スワップファイルを %2$@ で使用中"; 115 | "%@ encrypted swap files present in %@" = "%1$@ つの暗号化スワップファイルを %2$@ で使用中"; 116 | // Maximum swap count info 117 | "%@ swap file at peak usage" = "最大使用時で %1$@ つのスワップファイル"; 118 | "%@ swap files at peak usage" = "最大使用時で %1$@ つのスワップファイル"; 119 | // Swap space info, as with free/used/total the float format and MB label 120 | // are handled automatically by NSFormatter 121 | "%@ total swap space" = "スワップ容量合計:%1$@"; 122 | // Swap space including used info (Tiger only) 123 | "%@ total swap space (%@ used)" = "スワップ容量合計:%1$@ (使用中:%2$@)"; 124 | 125 | // Menubar display labels for throughput, Tx and Rx also used for Tx and Rx menu items 126 | "Tx:" = "out:"; 127 | "Rx:" = "in:"; 128 | 129 | // Unit labels 130 | "Gbps" = "Gbps"; 131 | "Mbps" = "Mbps"; 132 | "Kbps" = "Kbps"; 133 | "B" = "B"; 134 | "KB" = "KB"; 135 | "MB" = "MB"; 136 | "GB" = "GB"; 137 | "B/s" = "B/s"; 138 | "KB/s" = "KB/s"; 139 | "MB/s" = "MB/s"; 140 | "GB/s" = "GB/s"; 141 | 142 | // PPP connection titles and states 143 | "PPP:" = "PPP:"; 144 | "Not Connected" = "接続されていません"; 145 | "Connecting..." = "接続中..."; 146 | "Connected" = "接続されました"; 147 | "Connected %02d:%02d:%02d" = "%1$02d:%2$02d:%3$02d に接続完了"; 148 | "Disconnecting..." = "切断中..."; 149 | 150 | // TCP/IP menu titles 151 | "TCP/IP:" = "TCP/IP:"; 152 | "IPv4:" = "IPv4:"; 153 | "IPv6:" = "IPv6:"; 154 | 155 | // Label for inactive TCP/IP interfaces 156 | "Inactive" = "無効"; 157 | 158 | // AppleTalk menu title 159 | "AppleTalk:" = "AppleTalk:"; 160 | 161 | // Format string for AppleTalk display info 162 | "Net: %@ Node: %@ Zone: %@" = "ネット:%1$@、ノード:%2$@、ゾーン:%3$@"; 163 | 164 | // Throughput menu title 165 | "Throughput:" = "通信速度:"; 166 | 167 | // Peak throughput menu title 168 | "Peak Throughput:" = "通信速度(ピーク):"; 169 | 170 | // Traffic totals menu title 171 | "Traffic Totals:" = "トラフィック合計:"; 172 | 173 | // Traffic total format string. The Tx and Rx labels from above are automatically used 174 | // as the first param, and numbers are localized automatically by NSNumberFormatter 175 | // ex: "Tx: XX.XMB (XXX,XXX bytes) 176 | "%@ %@ (%@ bytes)" = "%1$@ %2$@ (%3$@ バイト)"; 177 | 178 | // Menu action title strings 179 | "Open Network Utility" = "ネットワークユーティリティを開く"; 180 | "Open Network Preferences" = "ネットワーク環境設定を開く"; 181 | "Open Internet Connect" = "インターネット接続を開く"; 182 | "Display primary interface" = "プライマリネットワークポートを表示"; 183 | "Display this interface" = "このネットワークポートを表示"; 184 | "Copy IPv4 address" = "IPv4 アドレスをコピーする"; 185 | "Copy IPv6 address" = "IPv6 アドレスをコピーする"; 186 | "Reset traffic totals" = "トラフィック合計をリセット"; 187 | "Connect" = "接続"; 188 | "Disconnect" = "切断"; 189 | 190 | // Miscellaneous error strings 191 | "No Active Interfaces" = "有効なネットワークポートがありません"; 192 | -------------------------------------------------------------------------------- /MenuMetersApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MenuMetersApp 4 | // 5 | // Created by Yuji on 2015/07/30. 6 | // 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /MenuMetersMenuExtraBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMenuExtraBase.h 3 | // MenuMeters 4 | // 5 | // Created by Yuji on 2015/08/01. 6 | // 7 | // 8 | 9 | #import 10 | #import "LocalizedStrings.h" 11 | 12 | @class MenuMeterDefaults; 13 | 14 | @interface MenuMetersMenuExtraBase : NSObject 15 | { 16 | NSStatusItem* statusItem; 17 | NSTimer* updateTimer; 18 | CGFloat menuWidth; 19 | } 20 | -(NSColor*)colorByAdjustingForLightDark:(NSColor*)c; 21 | - (NSImage*)image; 22 | - (NSMenu*)menu; 23 | -(void)setupColor:(NSNotification*)notification; 24 | - (void)configDisplay:(NSString*)bundleID fromPrefs:(MenuMeterDefaults*)ourPrefs withTimerInterval:(NSTimeInterval)interval; 25 | - (void)configFromPrefs:(NSNotification*)notification; 26 | - (void)timerFired:(id)timer; 27 | - (void)openMenuMetersPref:(id)sender; 28 | - (void)openActivityMonitor:(id)sender; 29 | - (void)addStandardMenuEntriesTo:(NSMenu*)extraMenu; 30 | - (void)setupAppearance; 31 | - (BOOL)isDark; 32 | - (BOOL)isInstalledButHiddenBySystem; 33 | - (CGFloat)height; 34 | - (CGFloat)imageHeight; 35 | - (BOOL)renderImage; 36 | -(NSColor*)menuBarTextColor; 37 | -(instancetype)initWithBundleID:(NSString*)bundleID; 38 | @property(nonatomic, readonly) BOOL isMenuVisible; 39 | @property(nonatomic, retain) NSString*bundleID; 40 | @end 41 | 42 | #define NSMenuExtra MenuMetersMenuExtraBase 43 | #define kOpenMenuMetersPref @"Open MenuMeters preferences" 44 | #define kOpenActivityMonitorTitle @"Open Activity Monitor" 45 | 46 | -------------------------------------------------------------------------------- /PrefPane/EMCLoginItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2014 Enrico M. Crisostomo. All rights reserved. 3 | // 4 | // License: BSD 3-Clause License 5 | // (http://opensource.org/licenses/BSD-3-Clause) 6 | // 7 | 8 | #import 9 | 10 | @interface EMCLoginItem : NSObject 11 | 12 | - (instancetype)init; 13 | - (instancetype)initWithBundle:(NSBundle *)bundle; 14 | - (instancetype)initWithPath:(NSString *)path; 15 | 16 | - (BOOL)isLoginItem; 17 | - (void)addLoginItem; 18 | - (void)removeLoginItem; 19 | - (void)addAfterLast; 20 | - (void)addAfterFirst; 21 | - (void)addAfterItemWithPath:(NSString *)path; 22 | - (void)addAfterBundle:(NSBundle *)bundle; 23 | - (void)setIconRef:(IconRef)iconRef; 24 | 25 | + (instancetype)loginItem; 26 | + (instancetype)loginItemWithBundle:(NSBundle *)bundle; 27 | + (instancetype)loginItemWithPath:(NSString *)path; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /PrefPane/Icon/MenuMetersPref.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/Icon/MenuMetersPref.tiff -------------------------------------------------------------------------------- /PrefPane/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | MenuMeters 9 | CFBundleGetInfoString 10 | MM_COPYRIGHT 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | MenuMeters 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | MM_VERSION 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | MM_VERSION 25 | NSMainNibFile 26 | MenuMetersPref 27 | NSPrefPaneIconFile 28 | MenuMetersPref.tiff 29 | NSPrincipalClass 30 | MenuMetersPref 31 | 32 | 33 | -------------------------------------------------------------------------------- /PrefPane/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | CFBundleName = "MenuMeters"; 2 | -------------------------------------------------------------------------------- /PrefPane/MenuMetersPref.h: -------------------------------------------------------------------------------- 1 | // 2 | // MenuMetersPrefPane.h 3 | // 4 | // MenuMeters pref panel 5 | // 6 | // Copyright (c) 2002-2014 Alex Harper 7 | // 8 | // This file is part of MenuMeters. 9 | // 10 | // MenuMeters is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License version 2 as 12 | // published by the Free Software Foundation. 13 | // 14 | // MenuMeters is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with MenuMeters; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | // 23 | 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import "MenuMeters.h" 31 | #import "MenuMeterDefaults.h" 32 | #import "MenuMeterWorkarounds.h" 33 | #import "MenuMeterCPU.h" 34 | #import "MenuMeterDisk.h" 35 | #import "MenuMeterMem.h" 36 | #import "MenuMeterNet.h" 37 | #import "MenuMeterPowerMate.h" 38 | #ifdef SPARKLE 39 | #import 40 | #endif 41 | 42 | @interface MenuMetersPref : 43 | NSWindowController 44 | { 45 | 46 | // Our preferences 47 | MenuMeterDefaults *ourPrefs; 48 | // System config framework hooks 49 | SCDynamicStoreRef scSession; 50 | CFRunLoopSourceRef scRunSource; 51 | // Main controls 52 | IBOutlet NSTabView *prefTabs; 53 | __unsafe_unretained IBOutlet NSTextView *aboutView; 54 | // CPU pane controlsaverage 55 | IBOutlet NSButton *cpuMeterToggle; 56 | __weak IBOutlet NSButton *cpuPercentage; 57 | __weak IBOutlet NSButton *cpuGraph; 58 | __weak IBOutlet NSButton *cpuThermometer; 59 | __weak IBOutlet NSButton *cpuHorizontalThermometer; 60 | 61 | IBOutlet NSButton *cpuTemperatureToggle; 62 | __weak IBOutlet NSPopUpButton *cpuTemperatureUnit; 63 | IBOutlet NSTextField *cpuIntervalDisplay; 64 | IBOutlet NSSlider *cpuInterval; 65 | IBOutlet NSPopUpButton *cpuPercentMode; 66 | IBOutlet NSTextField *cpuPercentModeLabel; 67 | IBOutlet NSSlider *cpuMaxProcessCount; 68 | IBOutlet NSTextField *cpuMaxProcessCountCountLabel; 69 | IBOutlet NSSlider *cpuGraphWidth; 70 | IBOutlet NSTextField *cpuGraphWidthLabel; 71 | IBOutlet NSSlider *cpuHorizontalRows; 72 | IBOutlet NSTextField *cpuHorizontalRowsLabel; 73 | IBOutlet NSSlider *cpuMenuWidth; 74 | IBOutlet NSTextField *cpuMenuWidthLabel; 75 | IBOutlet NSPopUpButton *cpuMultipleCPU; 76 | IBOutlet NSButton *cpuPowerMate; 77 | IBOutlet NSPopUpButton *cpuPowerMateMode; 78 | IBOutlet NSColorWell *cpuUserColor; 79 | IBOutlet NSColorWell *cpuTemperatureColor; 80 | IBOutlet NSPopUpButton* cpuTemperatureSensor; 81 | IBOutlet NSTextField *cpuUserColorLabel; 82 | IBOutlet NSColorWell *cpuSystemColor; 83 | IBOutlet NSTextField *cpuSystemColorLabel; 84 | // Disk pane controls 85 | IBOutlet NSButton *diskMeterToggle; 86 | IBOutlet NSPopUpButton *diskImageSet; 87 | IBOutlet NSTextField *diskIntervalDisplay; 88 | IBOutlet NSSlider *diskInterval; 89 | IBOutlet NSPopUpButton *diskSelectMode; 90 | // Mem pane controls 91 | IBOutlet NSButton *memMeterToggle; 92 | IBOutlet NSPopUpButton *memDisplayMode; 93 | IBOutlet NSTextField *memIntervalDisplay; 94 | IBOutlet NSSlider *memInterval; 95 | IBOutlet NSButton *memFreeUsedLabeling; 96 | IBOutlet NSButton *memPageIndicator; 97 | IBOutlet NSSlider *memGraphWidth; 98 | IBOutlet NSTextField *memGraphWidthLabel; 99 | IBOutlet NSColorWell *memActiveColor; 100 | IBOutlet NSColorWell *memInactiveColor; 101 | IBOutlet NSColorWell *memWiredColor; 102 | IBOutlet NSColorWell *memCompressedColor; 103 | IBOutlet NSColorWell *memFreeColor; 104 | IBOutlet NSColorWell *memUsedColor; 105 | IBOutlet NSColorWell *memPageinColor; 106 | IBOutlet NSTextField *memPageinColorLabel; 107 | IBOutlet NSColorWell *memPageoutColor; 108 | IBOutlet NSTextField *memPageoutColorLabel; 109 | IBOutlet NSButton *memPressureMode; 110 | // Net pane controls 111 | IBOutlet NSButton *netMeterToggle; 112 | IBOutlet NSPopUpButton *netDisplayMode; 113 | IBOutlet NSPopUpButton *netDisplayOrientation; 114 | IBOutlet NSPopUpButton *netPreferInterface; 115 | IBOutlet NSPopUpButton *netScaleMode; 116 | IBOutlet NSTextField *netScaleModeLabel; 117 | IBOutlet NSPopUpButton *netScaleCalc; 118 | IBOutlet NSTextField *netScaleCalcLabel; 119 | IBOutlet NSTextField *netIntervalDisplay; 120 | IBOutlet NSSlider *netInterval; 121 | IBOutlet NSButton *netThroughputLabeling; 122 | IBOutlet NSButton *netThroughput1KBound; 123 | IBOutlet NSButton *netThroughputBits; 124 | IBOutlet NSPopUpButton *netGraphStyle; 125 | IBOutlet NSTextField *netGraphStyleLabel; 126 | IBOutlet NSSlider *netGraphWidth; 127 | IBOutlet NSTextField *netGraphWidthLabel; 128 | IBOutlet NSColorWell *netTxColor; 129 | IBOutlet NSColorWell *netRxColor; 130 | IBOutlet NSColorWell *netInactiveColor; 131 | __weak IBOutlet NSPopUpButton *updateIntervalButton; 132 | IBOutlet NSView *sparkleUIContainer; 133 | BOOL hiddenAlertIsShown; 134 | } // MenuMetersPref 135 | 136 | // Pref pane standard methods 137 | - (void)mainViewDidLoad; 138 | - (void)willSelect; 139 | - (void)didUnselect; 140 | 141 | #ifdef SPARKLE 142 | -(instancetype)initWithAboutFileName:(NSString*)about andUpdater:(SUUpdater*)updater_; 143 | #else 144 | -(instancetype)initWithAboutFileName:(NSString*)about; 145 | #endif 146 | // IB Targets 147 | -(IBAction)openAbout:(id)sender; 148 | - (IBAction)liveUpdateInterval:(id)sender; 149 | - (IBAction)cpuPrefChange:(id)sender; 150 | - (IBAction)diskPrefChange:(id)sender; 151 | - (IBAction)memPrefChange:(id)sender; 152 | - (IBAction)netPrefChange:(id)sender; 153 | 154 | @end 155 | -------------------------------------------------------------------------------- /PrefPane/Scales/CubeRootScale.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/Scales/CubeRootScale.tiff -------------------------------------------------------------------------------- /PrefPane/Scales/LinearScale.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/Scales/LinearScale.tiff -------------------------------------------------------------------------------- /PrefPane/Scales/LogScale.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/Scales/LogScale.tiff -------------------------------------------------------------------------------- /PrefPane/Scales/SquareRootScale.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/Scales/SquareRootScale.tiff -------------------------------------------------------------------------------- /PrefPane/de.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Menu Extra konnte nicht geladen werden!"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "Bitte folgen Sie der Anleitung zur Aktivierung von \„Menu Extras\“."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Farbige Pfeile"; 8 | "Arrows" = "Pfeile"; 9 | "Lights" = "Lämpchen"; 10 | "Aqua Lights" = "„Aqua“-Leuchten"; 11 | "Disk Arrows" = "Pfeile auf Festplatte"; 12 | "Disk Arrows (large)" = "Große Pfeile auf Festplatte"; 13 | -------------------------------------------------------------------------------- /PrefPane/en.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Menu Extra Could Not Load"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "For instructions on enabling third-party menu extras please see the documentation."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Color Arrows"; 8 | "Arrows" = "Arrows"; 9 | "Lights" = "Lights"; 10 | "Aqua Lights" = "Aqua Lights"; 11 | "Disk Arrows" = "Disk Arrows"; 12 | "Disk Arrows (large)" = "Disk Arrows (large)"; 13 | -------------------------------------------------------------------------------- /PrefPane/fi.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Menu Extra Could Not Load"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "For instructions on enabling third-party menu extras please see the documentation."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Värinuolet"; 8 | "Arrows" = "Nuolet"; 9 | "Lights" = "Valot"; 10 | "Aqua Lights" = "Aqua-valot"; 11 | "Disk Arrows" = "Levy ja nuolet"; 12 | "Disk Arrows (large)" = "Levy ja nuolet (suuret)"; 13 | -------------------------------------------------------------------------------- /PrefPane/fr.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Chargement de Menu Extra impossible"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "Pour des instructions sur l'activation des extras menus tierces parties, reportez-vous à la documentation."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Flèches de couleurs"; 8 | "Arrows" = "Flèches"; 9 | "Lights" = "Leds"; 10 | "Aqua Lights" = "Leds Aqua"; 11 | "Disk Arrows" = "Flèches disque"; 12 | "Disk Arrows (large)" = "Flèches disque (larges)"; 13 | -------------------------------------------------------------------------------- /PrefPane/it.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Impossibile Caricare Menu Extra"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "Per istruzioni su come attivare i menu extra di terze parti vedere la documentazione."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Frecce Colorate"; 8 | "Arrows" = "Frecce"; 9 | "Lights" = "Luci"; 10 | "Aqua Lights" = "Luci Aqua"; 11 | "Disk Arrows" = "Frecce Disco"; 12 | "Disk Arrows (large)" = "Frecce Disco (grandi)"; 13 | -------------------------------------------------------------------------------- /PrefPane/ja.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "メニューエクストラが読み込めません。"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "サードパーティ製のメニューエクストラを利用するにはマニュアルをご覧下さい。"; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "矢印 (緑/赤)"; 8 | "Arrows" = "矢印"; 9 | "Lights" = "ライト"; 10 | "Aqua Lights" = "アクアライト"; 11 | "Disk Arrows" = "ディスクに矢印"; 12 | "Disk Arrows (large)" = "ディスクに矢印 (大)"; 13 | -------------------------------------------------------------------------------- /PrefPane/nl.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "De Menu-extra kon niet worden geladen"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "Raadpleeg de documentatie voor informatie over het mogelijk maken van niet-Apple menu-extra\'s."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Gekleurde pijltjes"; 8 | "Arrows" = "Pijltjes"; 9 | "Lights" = "Lampjes"; 10 | "Aqua Lights" = "Aqua-lampjes"; 11 | "Disk Arrows" = "Disk-pijltjes"; 12 | "Disk Arrows (large)" = "Grote disk-pijltjes"; 13 | -------------------------------------------------------------------------------- /PrefPane/nl.lproj/MenuMetersPref.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/PrefPane/nl.lproj/MenuMetersPref.strings -------------------------------------------------------------------------------- /PrefPane/tr.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Menü ekstrası yüklenemedi"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "Üçüncü parti menü ekstralarını etkinleştirme yönergeleri için belgelendirmeye bakın."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "Renkli Oklar"; 8 | "Arrows" = "Oklar"; 9 | "Lights" = "Işıklar"; 10 | "Aqua Lights" = "Su Işıkları"; 11 | "Disk Arrows" = "Disk Okları"; 12 | "Disk Arrows (large)" = "Disk Okları (büyük)"; 13 | -------------------------------------------------------------------------------- /PrefPane/zh-Hans.lproj/DiskImageSet.strings: -------------------------------------------------------------------------------- 1 | // Strings for menu abort sheet 2 | "Menu Extra Could Not Load" = "Menu Extra Could Not Load"; 3 | "For instructions on enabling third-party menu extras please see the documentation." = 4 | "For instructions on enabling third-party menu extras please see the documentation."; 5 | 6 | // Strings for the disk icon sets 7 | "Color Arrows" = "彩色箭头"; 8 | "Arrows" = "箭头"; 9 | "Lights" = "灯"; 10 | "Aqua Lights" = "Aqua 灯"; 11 | "Disk Arrows" = "磁盘箭头"; 12 | "Disk Arrows (large)" = "磁盘箭头(大)"; 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MenuMeters 2 | My fork of MenuMeters for El Capitan, Sierra, High Sierra, Mojave, Catalina and Big Sur. 3 | 4 | # Usage: 5 | If you just want to use it, please go to http://member.ipmu.jp/yuji.tachikawa/MenuMetersElCapitan/ or https://github.com/yujitach/MenuMeters/releases and download the binary. The detailed installation instruction is given in the former. 6 | 7 | # Other versions & related open source softwares: 8 | 9 | If you run sufficiently new mac OS, try one of 10 | 11 | - https://github.com/exelban/stats 12 | - https://iglance.github.io 13 | - https://github.com/gao-sun/eul 14 | 15 | which are all menubar monitors with more modern look and feel and more capability. What is more, they are maintained actively. They are heavily recommended. 16 | 17 | There are also further forks of my version of MenuMeters, which implement more features. You might want to try them out: 18 | 19 | - https://github.com/emcrisostomo/MenuMeters which has DMG installers 20 | - https://gitlab.com/axet/MenuMeters which has new features in the CPU meter, etc. 21 | 22 | If you'd like your version mentioned here, please tell me at the issues page. 23 | 24 | # Background: 25 | 26 | It's a great utility originally developed at http://www.ragingmenace.com/software/menumeters/ . 27 | The original version does not work on El Capitan and later, due to the fact that SystemUIServer doesn't load Menu Extras not signed by Apple any longer. 28 | 29 | I'm making here a minimal modification so that it runs as a faceless app, putting NSStatusItem's instead of NSMenuExtra's. 30 | Since then, many people contributed pull requests, most of which have been incorporated. 31 | 32 | More recently, starting from Catalina, MenuMeters was changed from a preference pane within System Preferences to an independent app. This is due to an increasing amount of security features imposed by Apple on preference panes running within System Preferences, which made it too cumbersome to develop MenuMeters as a preference pane. 33 | 34 | # To hack: 35 | Clone the git repo, open MenuMeters.xcodeproj, and build the target *MenuMeters*. This will create an independent app which runs outside of System Preferences. 36 | -------------------------------------------------------------------------------- /Sparkle.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Sparkle.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Sparkle.framework/PrivateHeaders: -------------------------------------------------------------------------------- 1 | Versions/Current/PrivateHeaders -------------------------------------------------------------------------------- /Sparkle.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Sparkle.framework/Sparkle: -------------------------------------------------------------------------------- 1 | Versions/Current/Sparkle -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloadData.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloadData.h 3 | // Sparkle 4 | // 5 | // Created by Mayur Pawashe on 8/10/16. 6 | // Copyright © 2016 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "SUExport.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | /*! 20 | * A class for containing downloaded data along with some information about it. 21 | */ 22 | SU_EXPORT @interface SPUDownloadData : NSObject 23 | 24 | - (instancetype)initWithData:(NSData *)data textEncodingName:(NSString * _Nullable)textEncodingName MIMEType:(NSString * _Nullable)MIMEType; 25 | 26 | /*! 27 | * The raw data that was downloaded. 28 | */ 29 | @property (nonatomic, readonly) NSData *data; 30 | 31 | /*! 32 | * The IANA charset encoding name if available. Eg: "utf-8" 33 | */ 34 | @property (nonatomic, readonly, nullable, copy) NSString *textEncodingName; 35 | 36 | /*! 37 | * The MIME type if available. Eg: "text/plain" 38 | */ 39 | @property (nonatomic, readonly, nullable, copy) NSString *MIMEType; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloader.h 3 | // Downloader 4 | // 5 | // Created by Mayur Pawashe on 4/1/16. 6 | // Copyright © 2016 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | #import "SPUDownloaderProtocol.h" 15 | 16 | @protocol SPUDownloaderDelegate; 17 | 18 | // This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection. 19 | @interface SPUDownloader : NSObject 20 | 21 | // Due to XPC remote object reasons, this delegate is strongly referenced 22 | // Invoke cleanup when done with this instance 23 | - (instancetype)initWithDelegate:(id )delegate; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloaderDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloaderDelegate.h 3 | // Sparkle 4 | // 5 | // Created by Mayur Pawashe on 4/1/16. 6 | // Copyright © 2016 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class SPUDownloadData; 18 | 19 | @protocol SPUDownloaderDelegate 20 | 21 | // This is only invoked for persistent downloads 22 | - (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory; 23 | 24 | // Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0 25 | // This is only invoked for persistent downloads 26 | - (void)downloaderDidReceiveExpectedContentLength:(int64_t)expectedContentLength; 27 | 28 | // This is only invoked for persistent downloads 29 | - (void)downloaderDidReceiveDataOfLength:(uint64_t)length; 30 | 31 | // downloadData is nil if this is a persisent download, otherwise it's non-nil if it's a temporary download 32 | - (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable)downloadData; 33 | 34 | - (void)downloaderDidFailWithError:(NSError *)error; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloaderDeprecated.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloaderDeprecated.h 3 | // Sparkle 4 | // 5 | // Created by Deadpikle on 12/20/17. 6 | // Copyright © 2017 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #import "SPUDownloader.h" 10 | 11 | @interface SPUDownloaderDeprecated : SPUDownloader 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloaderProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloaderProtocol.h 3 | // PersistentDownloader 4 | // 5 | // Created by Mayur Pawashe on 4/1/16. 6 | // Copyright © 2016 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @class SPUURLRequest; 18 | 19 | // The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service. 20 | @protocol SPUDownloaderProtocol 21 | 22 | - (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename; 23 | 24 | - (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request; 25 | 26 | - (void)downloadDidFinish; 27 | 28 | - (void)cleanup; 29 | 30 | - (void)cancel; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUDownloaderSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUDownloaderSession.h 3 | // Sparkle 4 | // 5 | // Created by Deadpikle on 12/20/17. 6 | // Copyright © 2017 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | #import "SPUDownloader.h" 15 | #import "SPUDownloaderProtocol.h" 16 | 17 | NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0) 18 | @interface SPUDownloaderSession : SPUDownloader 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SPUURLRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPUURLRequest.h 3 | // Sparkle 4 | // 5 | // Created by Mayur Pawashe on 5/19/16. 6 | // Copyright © 2016 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | // A class that wraps NSURLRequest and implements NSSecureCoding 18 | // This class exists because NSURLRequest did not support NSSecureCoding in macOS 10.8 19 | // I have not verified if NSURLRequest in 10.9 implements NSSecureCoding or not 20 | @interface SPUURLRequest : NSObject 21 | 22 | // Creates a new URL request 23 | // Only these properties are currently tracked: 24 | // * URL 25 | // * Cache policy 26 | // * Timeout interval 27 | // * HTTP header fields 28 | // * networkServiceType 29 | + (instancetype)URLRequestWithRequest:(NSURLRequest *)request; 30 | 31 | @property (nonatomic, readonly) NSURLRequest *request; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUAppcast.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUAppcast.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/12/06. 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUAPPCAST_H 10 | #define SUAPPCAST_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @class SUAppcastItem; 22 | SU_EXPORT @interface SUAppcast : NSObject 23 | 24 | @property (copy, nullable) NSString *userAgentString; 25 | @property (copy, nullable) NSDictionary *httpHeaders; 26 | 27 | - (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err; 28 | - (SUAppcast *)copyWithoutDeltaUpdates; 29 | 30 | @property (readonly, copy, nullable) NSArray *items; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUAppcastItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUAppcastItem.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/12/06. 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUAPPCASTITEM_H 10 | #define SUAPPCASTITEM_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | @class SUSignatures; 19 | 20 | SU_EXPORT @interface SUAppcastItem : NSObject 21 | @property (copy, readonly) NSString *title; 22 | @property (copy, readonly) NSString *dateString; 23 | @property (copy, readonly) NSDate *date; 24 | @property (copy, readonly) NSString *itemDescription; 25 | @property (strong, readonly) NSURL *releaseNotesURL; 26 | @property (strong, readonly) SUSignatures *signatures; 27 | @property (copy, readonly) NSString *minimumSystemVersion; 28 | @property (copy, readonly) NSString *maximumSystemVersion; 29 | @property (strong, readonly) NSURL *fileURL; 30 | @property (nonatomic, readonly) uint64_t contentLength; 31 | @property (copy, readonly) NSString *versionString; 32 | @property (copy, readonly) NSString *osString; 33 | @property (copy, readonly) NSString *displayVersionString; 34 | @property (copy, readonly) NSDictionary *deltaUpdates; 35 | @property (strong, readonly) NSURL *infoURL; 36 | @property (copy, readonly) NSNumber* phasedRolloutInterval; 37 | 38 | // Initializes with data from a dictionary provided by the RSS class. 39 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 40 | - (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString **)error; 41 | 42 | @property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate; 43 | @property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate; 44 | @property (getter=isMacOsUpdate, readonly) BOOL macOsUpdate; 45 | @property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate; 46 | 47 | // Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. 48 | @property (readonly, copy) NSDictionary *propertiesDictionary; 49 | 50 | - (NSURL *)infoURL; 51 | 52 | @end 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUCodeSigningVerifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUCodeSigningVerifier.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 7/5/12. 6 | // 7 | // 8 | 9 | #ifndef SUCODESIGNINGVERIFIER_H 10 | #define SUCODESIGNINGVERIFIER_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | 19 | SU_EXPORT @interface SUCodeSigningVerifier : NSObject 20 | + (BOOL)codeSignatureAtBundleURL:(NSURL *)oldBundlePath matchesSignatureAtBundleURL:(NSURL *)newBundlePath error:(NSError **)error; 21 | + (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundlePath error:(NSError **)error; 22 | + (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundlePath; 23 | + (NSDictionary *)codeSignatureInfoAtBundleURL:(NSURL *)bundlePath; 24 | @end 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUErrors.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUErrors.h 3 | // Sparkle 4 | // 5 | // Created by C.W. Betts on 10/13/14. 6 | // Copyright (c) 2014 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #ifndef SUERRORS_H 10 | #define SUERRORS_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | 19 | /** 20 | * Error domain used by Sparkle 21 | */ 22 | SU_EXPORT extern NSString *const SUSparkleErrorDomain; 23 | 24 | #pragma clang diagnostic push 25 | #pragma clang diagnostic ignored "-Wc++98-compat" 26 | typedef NS_ENUM(OSStatus, SUError) { 27 | // Appcast phase errors. 28 | SUAppcastParseError = 1000, 29 | SUNoUpdateError = 1001, 30 | SUAppcastError = 1002, 31 | SURunningFromDiskImageError = 1003, 32 | SURunningTranslocated = 1004, 33 | 34 | // Download phase errors. 35 | SUTemporaryDirectoryError = 2000, 36 | SUDownloadError = 2001, 37 | 38 | // Extraction phase errors. 39 | SUUnarchivingError = 3000, 40 | SUSignatureError = 3001, 41 | 42 | // Installation phase errors. 43 | SUFileCopyFailure = 4000, 44 | SUAuthenticationFailure = 4001, 45 | SUMissingUpdateError = 4002, 46 | SUMissingInstallerToolError = 4003, 47 | SURelaunchError = 4004, 48 | SUInstallationError = 4005, 49 | SUDowngradeError = 4006, 50 | SUInstallationCancelledError = 4007, 51 | 52 | // System phase errors 53 | SUSystemPowerOffError = 5000 54 | }; 55 | #pragma clang diagnostic pop 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUExport.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUExport.h 3 | // Sparkle 4 | // 5 | // Created by Jake Petroules on 2014-08-23. 6 | // Copyright (c) 2014 Sparkle Project. All rights reserved. 7 | // 8 | 9 | #ifndef SUEXPORT_H 10 | #define SUEXPORT_H 11 | 12 | #ifdef BUILDING_SPARKLE 13 | #define SU_EXPORT __attribute__((visibility("default"))) 14 | #else 15 | #define SU_EXPORT 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUStandardVersionComparator.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUStandardVersionComparator.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 12/21/07. 6 | // Copyright 2007 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUSTANDARDVERSIONCOMPARATOR_H 10 | #define SUSTANDARDVERSIONCOMPARATOR_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | #import "SUVersionComparisonProtocol.h" 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | /*! 23 | Sparkle's default version comparator. 24 | 25 | This comparator is adapted from MacPAD, by Kevin Ballard. 26 | It's "dumb" in that it does essentially string comparison, 27 | in components split by character type. 28 | */ 29 | SU_EXPORT @interface SUStandardVersionComparator : NSObject 30 | 31 | /*! 32 | Initializes a new instance of the standard version comparator. 33 | */ 34 | - (instancetype)init; 35 | 36 | /*! 37 | Returns a singleton instance of the comparator. 38 | 39 | It is usually preferred to alloc/init new a comparator instead. 40 | */ 41 | + (SUStandardVersionComparator *)defaultComparator; 42 | 43 | /*! 44 | Compares version strings through textual analysis. 45 | 46 | See the implementation for more details. 47 | */ 48 | - (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | #endif 53 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUVersionComparisonProtocol.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 12/21/07. 6 | // Copyright 2007 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SUVERSIONCOMPARISONPROTOCOL_H 10 | #define SUVERSIONCOMPARISONPROTOCOL_H 11 | 12 | #if __has_feature(modules) 13 | @import Foundation; 14 | #else 15 | #import 16 | #endif 17 | #import "SUExport.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | /*! 22 | Provides version comparison facilities for Sparkle. 23 | */ 24 | @protocol SUVersionComparison 25 | 26 | /*! 27 | An abstract method to compare two version strings. 28 | 29 | Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, 30 | and NSOrderedSame if they are equivalent. 31 | */ 32 | - (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; // *** MAY BE CALLED ON NON-MAIN THREAD! 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | #endif 38 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/SUVersionDisplayProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUVersionDisplayProtocol.h 3 | // EyeTV 4 | // 5 | // Created by Uli Kusterer on 08.12.09. 6 | // Copyright 2009 Elgato Systems GmbH. All rights reserved. 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | #import "SUExport.h" 15 | 16 | /*! 17 | Applies special display formatting to version numbers. 18 | */ 19 | @protocol SUVersionDisplay 20 | 21 | /*! 22 | Formats two version strings. 23 | 24 | Both versions are provided so that important distinguishing information 25 | can be displayed while also leaving out unnecessary/confusing parts. 26 | */ 27 | - (void)formatVersion:(NSString *_Nonnull*_Nonnull)inOutVersionA andVersion:(NSString *_Nonnull*_Nonnull)inOutVersionB; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Headers/Sparkle.h: -------------------------------------------------------------------------------- 1 | // 2 | // Sparkle.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/16/06. (Modified by CDHW on 23/12/07) 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #ifndef SPARKLE_H 10 | #define SPARKLE_H 11 | 12 | // This list should include the shared headers. It doesn't matter if some of them aren't shared (unless 13 | // there are name-space collisions) so we can list all of them to start with: 14 | 15 | #pragma clang diagnostic push 16 | // Do not use <> style includes since 2.x has two frameworks that need to work: Sparkle and SparkleCore 17 | #pragma clang diagnostic ignored "-Wquoted-include-in-framework-header" 18 | 19 | #import "SUAppcast.h" 20 | #import "SUAppcastItem.h" 21 | #import "SUStandardVersionComparator.h" 22 | #import "SUUpdater.h" 23 | #import "SUUpdaterDelegate.h" 24 | #import "SUVersionComparisonProtocol.h" 25 | #import "SUVersionDisplayProtocol.h" 26 | #import "SUErrors.h" 27 | 28 | #import "SPUDownloader.h" 29 | #import "SPUDownloaderDelegate.h" 30 | #import "SPUDownloaderDeprecated.h" 31 | #import "SPUDownloadData.h" 32 | #import "SPUDownloaderProtocol.h" 33 | #import "SPUDownloaderSession.h" 34 | #import "SPUURLRequest.h" 35 | #import "SUCodeSigningVerifier.h" 36 | 37 | #pragma clang diagnostic pop 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Sparkle { 2 | umbrella header "Sparkle.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/PrivateHeaders/SUUnarchiver.h: -------------------------------------------------------------------------------- 1 | // 2 | // SUUnarchiver.h 3 | // Sparkle 4 | // 5 | // Created by Andy Matuschak on 3/16/06. 6 | // Copyright 2006 Andy Matuschak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol SUUnarchiverProtocol; 14 | 15 | @interface SUUnarchiver : NSObject 16 | 17 | + (nullable id )unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20B28 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Autoupdate 11 | CFBundleIconFile 12 | AppIcon.icns 13 | CFBundleIdentifier 14 | org.sparkle-project.Sparkle.Autoupdate 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.24.0 a-67-g0e162c98 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.24.0 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12C5020f 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 11.1 37 | DTSDKBuild 38 | 20C5048g 39 | DTSDKName 40 | macosx11.1 41 | DTXcode 42 | 1230 43 | DTXcodeBuild 44 | 12C5020f 45 | LSBackgroundOnly 46 | 1 47 | LSMinimumSystemVersion 48 | 10.7 49 | LSUIElement 50 | 1 51 | NSMainNibFile 52 | MainMenu 53 | NSPrincipalClass 54 | NSApplication 55 | 56 | 57 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/DarkAqua.css: -------------------------------------------------------------------------------- 1 | html { 2 | color: #FFFFFFD8; 3 | } 4 | :link { 5 | color: #419CFF; 6 | } 7 | :link:active { 8 | color: #FF1919; 9 | } 10 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20B28 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Sparkle 11 | CFBundleIdentifier 12 | org.sparkle-project.Sparkle 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Sparkle 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.24.0 a-67-g0e162c98 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.24.0 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12C5020f 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 11.1 37 | DTSDKBuild 38 | 20C5048g 39 | DTSDKName 40 | macosx11.1 41 | DTXcode 42 | 1230 43 | DTXcodeBuild 44 | 12C5020f 45 | LSMinimumSystemVersion 46 | 10.7 47 | 48 | 49 | -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Sparkle.framework/Versions/A/Sparkle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/Sparkle.framework/Versions/A/Sparkle -------------------------------------------------------------------------------- /Sparkle.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /baselocalizationfixes/cell.perl: -------------------------------------------------------------------------------- 1 | $/=">"; 2 | while(<>){ 3 | if(/id="(\d+)"/){ 4 | $id=$1; 5 | ($name)=/<([A-Za-z]+)/; 6 | if($name=~/Cell$/){ 7 | print "$lastid $id\n"; 8 | } 9 | $lastid=$id; 10 | } 11 | } -------------------------------------------------------------------------------- /baselocalizationfixes/en.map: -------------------------------------------------------------------------------- 1 | 481 1031 2 | 476 1030 3 | 420 1029 4 | 417 1028 5 | 414 1027 6 | 1093 1094 7 | 411 1026 8 | 401 1025 9 | 1087 1088 10 | 392 1024 11 | HDz-B0-gnE yxu-af-UDy 12 | 1110 1111 13 | 1079 1080 14 | 383 1023 15 | 381 1022 16 | 172 1021 17 | 1089 1090 18 | 1114 1117 19 | 1115 1116 20 | 166 1020 21 | 165 1019 22 | 154 1018 23 | 153 1017 24 | 152 1016 25 | 147 1015 26 | 144 1014 27 | 505 1013 28 | 501 1012 29 | 499 1011 30 | 209 1010 31 | 208 1009 32 | 207 1008 33 | 204 1007 34 | 202 1006 35 | 426 1039 36 | 423 1038 37 | 361 1037 38 | 224 1036 39 | 222 1035 40 | 221 1034 41 | 220 1033 42 | 218 1032 43 | 234 1047 44 | 235 1048 45 | 236 1049 46 | 601 1050 47 | 602 1051 48 | 514 1046 49 | 513 1045 50 | 512 1044 51 | 457 1043 52 | 451 1042 53 | 449 1041 54 | 430 1040 55 | 609 1077 56 | 589 1076 57 | 588 1075 58 | 540 1074 59 | 539 1073 60 | 524 1072 61 | 523 1071 62 | 519 1070 63 | 488 1069 64 | 486 1068 65 | 445 1067 66 | 442 1066 67 | 439 1065 68 | 405 1064 69 | 402 1063 70 | 400 1062 71 | 377 1061 72 | 362 1060 73 | 336 1059 74 | 331 1058 75 | 329 1057 76 | 298 1056 77 | 296 1055 78 | 295 1054 79 | 292 1053 80 | 291 1052 81 | 355 1078 82 | -------------------------------------------------------------------------------- /baselocalizationfixes/ja.map: -------------------------------------------------------------------------------- 1 | 481 880 2 | 476 879 3 | 420 878 4 | 417 877 5 | 414 876 6 | 411 875 7 | 401 874 8 | 392 873 9 | 383 872 10 | 381 871 11 | 172 870 12 | 166 869 13 | 165 868 14 | 154 867 15 | 153 866 16 | 152 865 17 | 147 864 18 | 144 863 19 | 928 929 20 | 933 938 21 | 934 937 22 | 935 936 23 | 942 943 24 | 944 947 25 | 945 946 26 | 505 862 27 | 501 861 28 | 499 860 29 | 209 859 30 | 208 858 31 | 207 857 32 | 204 856 33 | 202 855 34 | 426 888 35 | 423 887 36 | 361 886 37 | 224 885 38 | 222 884 39 | 221 883 40 | 220 882 41 | 218 881 42 | 234 896 43 | 235 897 44 | 236 898 45 | 601 899 46 | 602 900 47 | 514 895 48 | 513 894 49 | 512 893 50 | 457 892 51 | 451 891 52 | 449 890 53 | 430 889 54 | 609 926 55 | 589 925 56 | 588 924 57 | 540 923 58 | 539 922 59 | 524 921 60 | 523 920 61 | 519 919 62 | 488 918 63 | 486 917 64 | 445 916 65 | 442 915 66 | 439 914 67 | 405 913 68 | 402 912 69 | 400 911 70 | 377 910 71 | 362 909 72 | 336 908 73 | 331 907 74 | 329 906 75 | 298 905 76 | 296 904 77 | 295 903 78 | 292 902 79 | 291 901 80 | 355 927 81 | -------------------------------------------------------------------------------- /baselocalizationfixes/rewrite.perl: -------------------------------------------------------------------------------- 1 | open(IN,"en.map"); 2 | while(){ 3 | chomp; 4 | ($view,$cell)=split " "; 5 | $viewToCell{$view}=$cell; 6 | } 7 | close(IN); 8 | open(IN,"ja.map"); 9 | while(){ 10 | chomp; 11 | ($view,$cell)=split " "; 12 | $cellToView{$cell}=$view; 13 | } 14 | close(IN); 15 | while(<>){ 16 | if(/"(\d+).title/){ 17 | $cell=$1; 18 | if(exists $cellToView{$cell}){ 19 | $newcell=$viewToCell{$cellToView{$cell}}; 20 | s/"\d+.title/"$newcell.title/; 21 | } 22 | } 23 | if(/ObjectID = "(\d+)"/){ 24 | $cell=$1; 25 | if(exists $cellToView{$cell}){ 26 | $newcell=$viewToCell{$cellToView{$cell}}; 27 | s/ObjectID = "\d+"/ObjectID = "$newcell"/; 28 | } 29 | } 30 | print; 31 | } -------------------------------------------------------------------------------- /com.ragingmenace.MenuMeters.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yujitach/MenuMeters/e91b746debd15777012968a4d247a074d10402f6/com.ragingmenace.MenuMeters.plist -------------------------------------------------------------------------------- /hardware_reader/TemperatureReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // TemperatureReader.h 3 | // MenuMeters 4 | // 5 | // Created by Yuji on 1/31/21. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface TemperatureReader : NSObject 13 | +(NSArray*)sensorNames; 14 | +(NSString*)defaultSensor; 15 | +(NSString*)displayNameForSensor:(NSString*)name; 16 | +(float)temperatureOfSensorWithName:(NSString*)name; 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /hardware_reader/TemperatureReader.m: -------------------------------------------------------------------------------- 1 | // 2 | // TemperatureReader.m 3 | // MenuMeters 4 | // 5 | // Created by Yuji on 1/31/21. 6 | // 7 | 8 | #import "TemperatureReader.h" 9 | #if TARGET_CPU_X86_64 10 | #import "smc_reader.h" 11 | #elif TARGET_CPU_ARM64 12 | #import "applesilicon_hardware_reader.h" 13 | #endif 14 | 15 | @implementation TemperatureReader 16 | +(NSArray*)sensorNames 17 | { 18 | static dispatch_once_t once; 19 | static NSArray*sensorNames; 20 | dispatch_once(&once, ^{ 21 | #if TARGET_CPU_X86_64 22 | if (kIOReturnSuccess == SMCOpen()) { 23 | UInt32 count; 24 | NSMutableArray*a=[NSMutableArray array]; 25 | SMCReadKeysCount(&count); 26 | for(int i=0;i 9 | #import "applesilicon_hardware_reader.h" 10 | 11 | // This code is based on https://github.com/fermion-star/apple_sensors/blob/master/temp_sensor.m 12 | // which was in turn based on https://github.com/freedomtan/sensors/blob/master/sensors/sensors.m 13 | // whose detail can be found in https://www2.slideshare.net/kstan2/exploring-thermal-related-stuff-in-idevices-using-opensource-tool 14 | 15 | 16 | #include 17 | 18 | // Declarations from other IOKit source code 19 | 20 | typedef struct __IOHIDEvent *IOHIDEventRef; 21 | typedef struct __IOHIDServiceClient *IOHIDServiceClientRef; 22 | #ifdef __LP64__ 23 | typedef double IOHIDFloat; 24 | #else 25 | typedef float IOHIDFloat; 26 | #endif 27 | 28 | IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef allocator); 29 | int IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef client, CFDictionaryRef match); 30 | int IOHIDEventSystemClientSetMatchingMultiple(IOHIDEventSystemClientRef client, CFArrayRef match); 31 | IOHIDEventRef IOHIDServiceClientCopyEvent(IOHIDServiceClientRef, int64_t , int32_t, int64_t); 32 | CFTypeRef _Nullable IOHIDServiceClientCopyProperty(IOHIDServiceClientRef service, CFStringRef key); 33 | IOHIDFloat IOHIDEventGetFloatValue(IOHIDEventRef event, int32_t field); 34 | 35 | //extern uint64_t my_mhz(void); 36 | //extern void mybat(void); 37 | // Primary Usage Page: 38 | // kHIDPage_AppleVendor = 0xff00, 39 | // kHIDPage_AppleVendorTemperatureSensor = 0xff05, 40 | // kHIDPage_AppleVendorPowerSensor = 0xff08, 41 | // 42 | // Primary Usage: 43 | // kHIDUsage_AppleVendor_TemperatureSensor = 0x0005, 44 | // kHIDUsage_AppleVendorPowerSensor_Current = 0x0002, 45 | // kHIDUsage_AppleVendorPowerSensor_Voltage = 0x0003, 46 | // See IOHIDFamily/AppleHIDUsageTables.h for more information 47 | // https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-701.60.2/IOHIDFamily/AppleHIDUsageTables.h.auto.html 48 | 49 | 50 | #define IOHIDEventFieldBase(type) (type << 16) 51 | #define kIOHIDEventTypeTemperature 15 52 | #define kIOHIDEventTypePower 25 53 | 54 | static dispatch_once_t once=0; 55 | static IOHIDEventSystemClientRef eventSystem; 56 | 57 | static void initEventSystem(){ 58 | dispatch_once(&once,^{ 59 | eventSystem = IOHIDEventSystemClientCreate(kCFAllocatorDefault); // in CFBase.h = NULL 60 | }); 61 | } 62 | 63 | NSArray*AppleSiliconTemperatureSensorNames(void) 64 | { 65 | initEventSystem(); 66 | 67 | NSDictionary*thermalSensors=@{@"PrimaryUsagePage":@(0xff00),@"PrimaryUsage":@(5)}; 68 | 69 | 70 | // ... this is the same as using kCFAllocatorDefault or the return value from CFAllocatorGetDefault() 71 | IOHIDEventSystemClientSetMatching(eventSystem, (__bridge CFDictionaryRef)thermalSensors); 72 | NSArray* matchingsrvs = CFBridgingRelease(IOHIDEventSystemClientCopyServices(eventSystem)); // matchingsrvs = matching services 73 | 74 | 75 | NSMutableArray*array=[NSMutableArray array]; 76 | for (NSObject* scx in matchingsrvs) { 77 | IOHIDServiceClientRef sc = (__bridge IOHIDServiceClientRef)scx; 78 | NSString* name = CFBridgingRelease(IOHIDServiceClientCopyProperty(sc, CFSTR("Product"))); // here we use ...CopyProperty 79 | if (name) { 80 | [array addObject:name]; 81 | } 82 | } 83 | 84 | 85 | return array; 86 | 87 | } 88 | 89 | float AppleSiliconTemperatureForName(NSString *productName) { 90 | initEventSystem(); 91 | 92 | NSDictionary *thermalSensors = @{@"PrimaryUsagePage": @(0xff00), 93 | @"PrimaryUsage": @(5), 94 | @"Product":productName}; 95 | // ... this is the same as using kCFAllocatorDefault or the return value from CFAllocatorGetDefault() 96 | IOHIDEventSystemClientSetMatching(eventSystem, (__bridge CFDictionaryRef)thermalSensors); 97 | NSArray* matchingsrvs = CFBridgingRelease(IOHIDEventSystemClientCopyServices(eventSystem)); // matchingsrvs = matching services 98 | float temp=-273.15F; 99 | if(matchingsrvs){ 100 | if([matchingsrvs count]>0){ 101 | IOHIDServiceClientRef sc = (__bridge IOHIDServiceClientRef)matchingsrvs[0]; 102 | IOHIDEventRef event = IOHIDServiceClientCopyEvent(sc, kIOHIDEventTypeTemperature, 0, 0); // here we use ...CopyEvent 103 | if (event) { 104 | temp = IOHIDEventGetFloatValue(event, IOHIDEventFieldBase(kIOHIDEventTypeTemperature)); 105 | CFRelease(event); 106 | } 107 | } 108 | } 109 | 110 | return temp; 111 | } 112 | -------------------------------------------------------------------------------- /hardware_reader/smc_reader.h: -------------------------------------------------------------------------------- 1 | #ifndef smc_reader_h 2 | #define smc_reader_h 3 | 4 | #include 5 | 6 | #define IO_SERVICE_NAME "AppleSMC" 7 | 8 | #define KERNEL_INDEX_SMC 2 9 | 10 | #define SMC_CMD_READ_BYTES 5 11 | #define SMC_CMD_WRITE_BYTES 6 12 | #define SMC_CMD_READ_INDEX 8 13 | #define SMC_CMD_READ_KEYINFO 9 14 | #define SMC_CMD_READ_PLIMIT 11 15 | #define SMC_CMD_READ_VERS 12 16 | 17 | #define toSMCCode(str) (SMCCode){{str[3], str[2], str[1], str[0]}} 18 | 19 | #define SMC_DATATYPE_FPE2 toSMCCode("fpe2") 20 | #define SMC_DATATYPE_FDS toSMCCode("{fds") 21 | #define SMC_DATATYPE_UINT8 toSMCCode("ui8 ") 22 | #define SMC_DATATYPE_UINT16 toSMCCode("ui16") 23 | #define SMC_DATATYPE_UINT32 toSMCCode("ui32") 24 | #define SMC_DATATYPE_SP78 toSMCCode("sp78") 25 | #define SMC_DATATYPE_FLAG toSMCCode("flag") 26 | #define SMC_DATATYPE_HEX toSMCCode("hex_") 27 | #define SMC_DATATYPE_FLT toSMCCode("flt ") 28 | #define SMC_DATATYPE_CH8 toSMCCode("ch8*") 29 | #define SMC_DATATYPE_MSS toSMCCode("{mss") 30 | #define SMC_DATATYPE_SI8 toSMCCode("si8 ") 31 | #define SMC_DATATYPE_FP6A toSMCCode("fp6a") 32 | #define SMC_DATATYPE_FP88 toSMCCode("fp88") 33 | #define SMC_DATATYPE_JST toSMCCode("{jst") 34 | #define SMC_DATATYPE_FP1F toSMCCode("fp1f") 35 | #define SMC_DATATYPE_SI16 toSMCCode("si16") 36 | #define SMC_DATATYPE_ALP toSMCCode("{alp") 37 | #define SMC_DATATYPE_ALC toSMCCode("{alc") 38 | #define SMC_DATATYPE_ALI toSMCCode("{ali") 39 | #define SMC_DATATYPE_ALV toSMCCode("{alv") 40 | 41 | #define UI32_TO_UINT32(bytes) (bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3]) 42 | #define UI16_TO_UINT32(bytes) (bytes[0] << 8 | bytes[1]) 43 | #define UI8_TO_UINT32(bytes) (bytes[0]) 44 | #define SP78_TO_CELSIUS(bytes) (UI16_TO_UINT32(bytes) / 256.0F) 45 | #define FPE2_TO_UINT32(bytes) ((bytes[0] << 6) + (bytes[1] >> 2)) 46 | #define FLAG_TO_UINT32(bytes) (bytes[0]) 47 | 48 | typedef union { 49 | UInt8 code[4]; 50 | UInt32 type; 51 | } SMCCode; 52 | 53 | typedef struct { 54 | UInt8 major; 55 | UInt8 minor; 56 | UInt8 build; 57 | SInt8 reserved[1]; 58 | UInt16 release; 59 | } SMCKeyDataVersion; 60 | 61 | typedef struct { 62 | UInt16 version; 63 | UInt16 length; 64 | UInt32 cpuPLimit; 65 | UInt32 gpuPLimit; 66 | UInt32 memPLimit; 67 | } SMCKeyDataPLimitData; 68 | 69 | typedef struct { 70 | UInt32 dataSize; 71 | SMCCode dataType; 72 | UInt8 dataAttributes; 73 | } SMCKeyDataKeyInfo; 74 | 75 | typedef UInt8 SMCBytes[32]; 76 | 77 | #define SMC_CALL_RESULT_SUCCESS 0 78 | #define SMC_CALL_RESULT_ERROR 1 79 | #define SMC_CALL_RESULT_NOT_FOUND 0x84 80 | 81 | typedef struct { 82 | SMCCode key; 83 | SMCKeyDataVersion vers; 84 | SMCKeyDataPLimitData pLimitData; 85 | SMCKeyDataKeyInfo keyInfo; 86 | UInt8 result; 87 | UInt8 status; 88 | UInt8 data8; 89 | UInt32 data32; 90 | SMCBytes bytes; 91 | } SMCKeyData; 92 | 93 | typedef struct { 94 | SMCCode key; 95 | SMCKeyDataKeyInfo info; 96 | SMCBytes bytes; 97 | } SMCKeyValue; 98 | 99 | kern_return_t SMCOpen(void); 100 | kern_return_t SMCClose(void); 101 | 102 | kern_return_t SMCCall(int index, SMCKeyData *inputStructure, SMCKeyData *outputStructure); 103 | kern_return_t SMCReadKey(SMCCode key, SMCKeyValue *val); 104 | kern_return_t SMCReadKeysCount(UInt32 *count); 105 | kern_return_t SMCReadKeyAtIndex(UInt32 index, SMCKeyValue *val); 106 | 107 | NSDictionary* SMCHumanReadableDescriptions(void); 108 | 109 | #endif /* smc_reader_h */ 110 | -------------------------------------------------------------------------------- /releases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 |
20 |
2.1.6.1 (Nov/13/2021)
21 |
22 | Fixes a bug in the memory meter which I introduced while refactoring the old code base. 23 |
24 |
2.1.6 (Nov/11/2021)
25 |
26 | Fixes a couple of minor issues, and incorporates many of improvements by @schriftgestalt. 27 |
28 |
2.1.5 (Oct/28/2021)
29 |
30 | A crashing bug on new Macbook Pros was fixed thanks to @agraf. 31 |
32 |
2.1.4 (Feb/1/2021)
33 |
34 | The temperature sensor to be used is now selectable. 35 |
36 |
2.1.3 (Jan/25/2021)
37 |
38 | Shows the CPU temperature on Apple Silicon macs. 39 |
40 |
2.1.2.2 (Dec/15/2020)
41 |
42 | Fixes a bug in 2.1.2 where the CPU temperature in ℉ didn't show the top digit if it was above 100℉. 43 |
44 |
2.1.2.1 (Dec/12/2020)
45 |
46 | Fixes a bug in 2.1.2 which prevented the net meter to load in some cases. 47 |
48 |
2.1.2 (Dec/12/2020)
49 |
50 | Various minor improvements. If you have opened an issue on GitHub, please check if it has been resolved. 51 |
52 |
2.1.1 (Nov/26/2020)
53 |
54 | 1. A bug in the net meter on Big Sur was fixed, where it sometimes showed 0 bytes/sec unless the menu was brought up by clicking it.
55 | 2. Started preliminary Apple Silicon support. If the app crashes, please open it in Rosetta. 56 |
57 |
2.1.0 (Nov/23/2020)
58 |
59 | The order of various meters are correctly preserved across the launch on Big Sur. 60 |
61 |
2.0.9 (Nov/14/2020)
62 |
63 | You can finally choose colors with transparency. 64 | The auto-updater now sends basic system info such as the macOS version, the CPU type, etc. 65 |
66 |
2.0.8.3 (Nov/2/2020)
67 |
68 | Fixed a serious bug in 2.0.8 where the app does not correctly work when the menubar is in the auto-hide mode. 69 | Unfortunately the autoupdater itself is not working for those affected by this bug. 70 | I am sorry about the mess, and I thank many people who reported the issue. 71 | (2.0.8.2 was a partial update which made things actually worse.) 72 |
73 |
2.0.8.1 (Oct/30/2020)
74 |
75 | 1. Fixed a bug in 2.0.8 on the dark mode support for pre-Mojave Macs.
76 | 2. Activity monitor panes are now selected correctly with Macs with discrete GPUs.
77 | 3. Forgot to say that 2.0.8 includes a new German localization thanks to @schwedenmut. 78 |
79 |
2.0.8 (Oct/28/2020)
80 |
81 | 1. You can now tint the colors toward black/white depending on whether the system is in the light/dark mode, using a slider.
82 | 2. Activity Monitor can now be opened from any MenuMeter.
83 | 3. Many other bug fixes.
84 | 4. Probably with new bugs, due to my ongoing rewrite of the internals toward Big Sur. 85 |
86 |
2.0.7 (May/21/2020)
87 |
88 | CPU display modes are now configured in a saner way. You can now only show the CPU temperature, or even just a static label. 89 |
90 |
2.0.6.1 (May/3/2020)
91 |
92 | This update contains the dark mode fix I intended to include in 2.0.6. (The original 2.0.6 actually made things worse due to my stupid last minute change.) 93 |
94 |
2.0.6 (May/3/2020)
95 |
96 | Due to popular demand, you can now choose the interval to check the update. Also includes a fix for a dark mode bug. 97 |
98 |
2.0.5 (Apr/26/2020)
99 |
100 | What a different world we live in right now. New Finnish localization thanks to @lanurmi, and the fix for a CPU percentage bug thanks to @macmaxbh. 101 |
102 |
2.0.4 (Dec/14/2019)
103 |
104 | Option to show Fahrenheit instead of Celsius, and other bug fixes 105 |
106 |
2.0.3 (Dec/7/2019)
107 |
108 | Option to show physical cores only, and other bug fixes 109 |
110 |
2.0.2 (Dec/1/2019)
111 |
112 | Minor bug fixes 113 |
114 |
2.0.1 (Nov/29/2019)
115 |
116 | New icon by Emanuel Batalha <ebatalha@icloud.com> 117 |
118 |
2.0.0 (Oct/29/2019)
119 |
120 | the version number is bumped to test the Sparkle updater 121 |
122 |
1.9.9 (Oct/29/2019)
123 |
124 | a preliminary version which runs outside of System Preferences 125 |
126 |
127 | 128 | 129 | --------------------------------------------------------------------------------