mirror of
https://github.com/ish-app/ish.git
synced 2026-01-25 14:06:40 +00:00
Users really hate that we put "localhost" in their prompt as a result of iOS 16 anti-fingerprinting obfuscating the device name. We already have a mechanism for overriding this that we use for App Store screenshots, so we might as well make it official and expose it for those that care. The logic for what the actual uname hostname is as follows: * If the user sets the preference, use that. * On iOS <16, if the preference is unset, use what real uname returns. * On iOS 16+, use UIDevice.name. This at least changes "localhost" to something like "iPad".
87 lines
2.3 KiB
Objective-C
87 lines
2.3 KiB
Objective-C
//
|
|
// UserPreferences.h
|
|
// iSH
|
|
//
|
|
// Created by Charlie Melbye on 11/12/18.
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import "Theme.h"
|
|
|
|
typedef NS_ENUM(NSInteger, CapsLockMapping) {
|
|
__CapsLockMapFirst = 0,
|
|
CapsLockMapNone = 0,
|
|
CapsLockMapControl,
|
|
CapsLockMapEscape,
|
|
__CapsLockMapLast,
|
|
};
|
|
|
|
typedef enum : NSUInteger {
|
|
__OptionMapFirst = 0,
|
|
OptionMapNone = 0,
|
|
OptionMapEsc,
|
|
__OptionMapLast,
|
|
} OptionMapping;
|
|
|
|
typedef NS_ENUM(NSInteger, CursorStyle) {
|
|
__CursorStyleFirst = 0,
|
|
CursorStyleBlock = 0,
|
|
CursorStyleBeam,
|
|
CursorStyleUnderline,
|
|
__CursorStyleLast,
|
|
};
|
|
|
|
typedef NS_ENUM(NSInteger, ColorScheme) {
|
|
__ColorSchemeFirst = 0,
|
|
ColorSchemeMatchSystem = 0,
|
|
ColorSchemeAlwaysLight,
|
|
ColorSchemeAlwaysDark,
|
|
__ColorSchemeLast,
|
|
};
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
extern NSString *const kThemeForegroundColor;
|
|
extern NSString *const kThemeBackgroundColor;
|
|
|
|
@interface UserPreferences : NSObject
|
|
|
|
@property CapsLockMapping capsLockMapping;
|
|
@property OptionMapping optionMapping;
|
|
@property BOOL backtickMapEscape;
|
|
@property BOOL hideExtraKeysWithExternalKeyboard;
|
|
@property BOOL overrideControlSpace;
|
|
@property BOOL hideStatusBar;
|
|
@property (nonatomic) Theme *theme;
|
|
@property (nonatomic) Palette *palette;
|
|
@property BOOL shouldDisableDimming;
|
|
@property (null_resettable) NSString *fontFamily;
|
|
@property (readonly) NSString *fontFamilyUserFacingName;
|
|
@property (readonly) UIFont *approximateFont;
|
|
@property NSNumber *fontSize;
|
|
@property ColorScheme colorScheme;
|
|
@property (readonly) BOOL requestingDarkAppearance;
|
|
@property (readonly) UIUserInterfaceStyle userInterfaceStyle API_AVAILABLE(ios(12.0));
|
|
@property (readonly) UIKeyboardAppearance keyboardAppearance;
|
|
@property CursorStyle cursorStyle;
|
|
@property (readonly) NSString *htermCursorShape;
|
|
@property BOOL blinkCursor;
|
|
@property (readonly) UIStatusBarStyle statusBarStyle;
|
|
@property NSArray<NSString *> *launchCommand;
|
|
@property NSArray<NSString *> *bootCommand;
|
|
@property NSString *hostnameOverride;
|
|
// Same as above but returns nil if the user has never set the hostname
|
|
@property (readonly) NSString *_hostnameOverride;
|
|
|
|
+ (instancetype)shared;
|
|
|
|
- (BOOL)hasChangedLaunchCommand;
|
|
|
|
@end
|
|
|
|
extern NSString *const kPreferenceLaunchCommandKey;
|
|
extern NSString *const kPreferenceBootCommandKey;
|
|
extern NSString *const kHostnameOverrideKey;
|
|
|
|
NS_ASSUME_NONNULL_END
|