Remote control shit for OS X (w/ Android app)

Wazakindjes f351aea43e Added editorc0nfig =] 3 weeks ago
app e3495f565a Use custom notification layout to remove way excessive padding -.- Also enables using a full-colour icon [=[=[=[=[= 9 months ago
serbur 0c66d152be Add config var 'verbose' so I can suppress that fucking \!ping l0l 2 years ago
.editorconfig f351aea43e Added editorc0nfig =] 3 weeks ago
.gitignore da08f6f924 Updated Andr0id pr0ject files to work w/ Studio v4.0, simplified .gitignores (one inside Android st00dio dir for all that shit and one in the git root for errythang else), VERSION_CODE property file is now created if it doesn't exist, explicitly disable minify for debug builds, fixed/suppressed a bunch of code inspection warnings/errors, standardised version numbering (x.y.z), some security fixes (e.g no longer export services lmoa), build number on settings screen now includes build type (debug/release/etc), use commit() instead of apply() for prefs (the former makes it apply immediately, fuck that delayed bullshit), updated Gradle dependencies to the latest version where possibru, added custom project search sc0pe, reimported certain image assets cuz shit was bitching about improper DPI and pr0lly some other misc fixes xdxd 1 year ago
LICENSE 85aca91e8d Initial commit lol 3 years ago fc1801a556 Added note bout selecting build variant prior to compilan, also updated .apk kek 3 years ago

The fuck is this

This shit is a dankass remote control thanggGgGg for Mac OS X (I'll keep saying that instead of macOS, fucking deal w/ it). I mostly started it as a proof of concept for keks, but it's easily expanded to include actually useful features. xd Right now it's mostly for enabling laziness. [=[=[==[[=[

The server side is a Perl skrip which can/should be controlled by launchctl to properly make it run as a daemon. The commands it receives are turned into AppleScript cuz that shit has APIs all throughout the OS X system. ;] Also, since the server only runs in SSL/TLS mode you'll need a certificate trusted by the clients used.

The client side can be anything supporting a streaming (TCP) socket with TLS, but I'm using an Android app meinself (incl00ded in the app directory lol). This app has a target SDK of 25 which corresponds to Android 7.1 (I'm using 25 cuz that gives me full-size app icons w/o that adaptive cancer). If you're using a self-signed cert, you should be able to import it into Settings > Security > Credentials > Trusted CAs or smt similar and it'll be accepted. Alternatively you can just disable the cert check inside the app's settings. =]

Supported commands

Many also support shorthand versions, some of which aren't even shown here due to it becoming fucky to read. xd You could also just check the regexes in em Perl if you really wanna kn0.

  • !a[uth] <$key> => Required before doing anything else lol
  • !q[uit], !e[xit] => Attempt clean disconnect
  • !prev => Previous music track
  • !next => Next tracc
  • !play[pause] => Toggle play/pause
  • !vol[ume] <$volume | +$volume | +$volume> => Change/set volume (e.g. !vol -5, !vol +9, !vol 20);
  • !cur[rent]vol[ume] => Return current v0lume level obv m9
  • !m[ute] => Toggle mute
  • !lock[screen] => Locks the screen (i.e. go back to login/user selection screen), keeps all current applications running
  • !bright[ness] <$brightness | up | down | min | max> => Change/set brightness in a similar fashion as !volume
  • !cur[rent]bright[ness] => Return current brightness (hacky af but works, see sauce for that shit lmao)
  • !c[affeinate] <$timestring> => Prevent system/display sleep and screensaver yo (e.g. !c 1h 5m 10s, !c 1h5m10s, !c 30m), should be a built-in utility
  • !decaf[feinate] => Undo all caffeinates (i.e. kill that shit)


Just some good ol' Perl modules:

  • Config::IniFiles
  • File::Basename
  • IO::Handle
  • IO::Select
  • IO::Socket::INET
  • IO::Socket::SSL


Copy muhconf.ini.example to muhconf.ini and fire up een editor. All the options are explained in there so git to reading fam. The config file must be kept in the same dir as the skrip.

After that change the contents of the com.jemoeder.lief.meqqy.plist file, namely the line that says <string>/Users/[user]/[dir]/serbur/</string>. Then just copy it to ~/Library/LaunchAgents and run ./load. This makes sure it gets restarted after you reboot or log out and in again. Also it has a keepalive flag so if it died it'll be restarted. ;3

Muy importante: The !curbright is hacky as shit and it requires permission for "assistive" bullshit, in order to open windows in the background and still access their contents. So:

  • Go to System Preferences > Security & Privacy
  • Unlock that shit
  • Click Accessibility on the left side
  • See if is already in the list on the right, if it is then just check the box next to it and cl0se em sysprefs
  • If not: apparently OS X won't let you add files manually, so just run the serbur skrip and try to get the current brightness through it
  • You'll get a popup saying it needs assistive aids enabled, simply click the button that'll take you to sysprefs (which is already open so no biggie) and check the fucking box =]

Android specific shit

So since I included muh Android st00dio projeckt in this repo as well, you'll need to make some adjustments if you want to release signed APKs lol. Also, I left the example testing classes in there just in case lel.

In the build.gradle file there are these 4 lines:

storeFile file(getPassword(currentUser, "ANDROID_KEY_STORE"))
storePassword getPassword(currentUser, "ANDROID_STORE_PASSWORD")
keyAlias getPassword(currentUser, "ANDROID_KEY_ALIAS")
keyPassword getPassword(currentUser, "ANDROID_KEY_PASSWORD")

These mean that all signing information (key store file, its password, your key alias and the key password) is st0red in the dankass OS X Keychain. So simply fire up the Keychain Access br0gram from Utilities and unlock the login keychain. Then on the bottom-left pick Passwords for categ0ry. Finally click on the small plus button at the very bottom and specify the fields as follows:

  • Keychain Item Name => one of the four above mentioned names (the ANDROID_* ones etc)
  • Account Name => your username (not display name), use Terminal > whoami to see this or just look at the name of your home directory
  • Password => the value


  • Keychain Item Name => ANDROID_KEY_STORE
  • Account Name => ayylmao
  • Password => /Users/ayylmao/pki/android_keystore.jks

Then repeat that shit for the others. ;] By doing it this way, your priv8 shit is never stored in the build.gradle file and it's safe to put it under version contr0l. Now, in order to build you won't be using Build > Generate Signed Bundle / APK. Use the Build > Build Bundle(s) / APK(s) option instead (don't forget to set the proper build variant first). ;] Otherwise it'll prompt you for keystore info bullshit anyways and fuck that.

Hurrrr pls halp it's br0ke

Simply ./unload that shit and do ./ in a terminal, you will most likely get some output that will give you an idea of wats goin on. =]