Skip to main content

Questions tagged [macos]

macOS (formerly known as OS X or Mac OS X) is the desktop operating system from Apple, found on Macintosh computers.

Filter by
Sorted by
Tagged with
2 votes
3 answers
167 views

Python Program Automatically Changing Mac Wallpaper to Nasa's Astronomy Picture of the Day

...
Astrovis's user avatar
  • 161
6 votes
1 answer
585 views

Play Snake Game on Mac OS Terminal using C with ncurses Library

Made a simple snake game in C. I am just having some fun with program and using this as a spring board of knowledge in hopes to get some confidence to maybe try different kinds of projects. I am ...
Alf's user avatar
  • 63
1 vote
1 answer
77 views

Javascript CLI to boot iOS simulators, install project, extract data, and merge into JSON

I'm a DIY "dev" - so I really create things that I need or think they'll end up helping others. I wrote this Swift Package so the iOS community could get device bezel radius' to help with UI ...
markb's user avatar
  • 171
4 votes
1 answer
2k views

Efficiency of wgpu-based 2D Batch Renderer

I've been working on a WebGPU-backed Rust renderer that batches together 2D colored sprites. I hadn't gotten onto the "sprite" portion of it yet, but I'm already finding some performance ...
n77's user avatar
  • 41
2 votes
1 answer
120 views

macOS: resetting balance to center (0.5) using Swift

Due to some bug somewhere, my speaker balance kept moving off-center and it was getting annoying. So I cobbled together the code below (based on this question) which—to my surprise—does compile and ...
luckman212's user avatar
10 votes
2 answers
1k views

Wi-fi scheduler written in C

I'm new to C and programming in general (some minimal prior exposure to JS and python). This is also my first time working with shell commands, scripts, and cron. This program works on my macOS and ...
NNNComplex's user avatar
3 votes
1 answer
108 views

Break music player into usable components in SwiftUI

I created a music player using swiftUI.I need to ask a question when I break up my player into usable components. How should I take this approach with the music player? because the music player is one ...
NinjaDeveloper's user avatar
1 vote
2 answers
243 views

Trying (and failing) to implement the best conventions on OOP Swift

I'm making a MacOS app that will do some analysis on the user's calendar data. For now it only supports Apple's native calendar (EventKit), but I will later add ...
Cornwell's user avatar
8 votes
2 answers
1k views

realpath substitute with --relative-to and --relative-base support

In a bash 3 script for OSX machines, I needed the functional equivalent of the realpath command, complete with support for the ...
Martijn Pieters's user avatar
2 votes
0 answers
23 views

bash script to delete files resurrected by Adobe InDesign bug

After a March update, Adobe Indesign will resurrect removed directories it was responsible for creating in the first place, but not any files except for one file called "AdobeFnt.lst". So where once ...
John Quirk's user avatar
2 votes
1 answer
132 views

Moving files from a directory to multiple with names same as file

I have a folder containing thousands of files and directories. I would like to move all the files that are not contained in a sub directory into a directory and name it the file name, while ...
aki's user avatar
  • 824
2 votes
0 answers
48 views

Bash script to scp specific, most-recent files from remote server

I'm writing a helper script that I wish to be able to share with my co-workers. We all work using macOS Mojave, but all have their own shell configurations. For example, I actually use ZSH and bash 5....
dylanjm's user avatar
  • 225
2 votes
0 answers
28 views

Auto re-connecting to a VPN on OS X and pointing Squid accordingly

We need to tunnel certain applications over a VPN at work. Ideally we would use a dedicated firewall/network appliance for this but the only permanent infrastructure we have are Mac Pro's running ...
Al Longley's user avatar
3 votes
1 answer
111 views

Batch rename files recursively, and number the directory index

When dealing with iOS app bundle, It is not convenient to get the file by its path, but loading it by its name. Need to batch rename images recursively, with Mac Bash. And to make the name unique, ...
dengST30's user avatar
  • 207
3 votes
1 answer
43 views

Batch rename files with Mac Bash,while the dir index should be recorded

I need to batch rename images with Mac Bash,while the directory index should be recorded. To rename files ,turn ...
dengST30's user avatar
  • 207
3 votes
1 answer
49 views

SSH autokiller for connections from other systems

I was messing around with ssh and decided to write a python program that scans for any connections that aren't from the system, then terminates them. It works well ...
Linny's user avatar
  • 10.4k
5 votes
1 answer
79 views

Java program that relaunches itself in OS's terminal application

I wrote a Java program that when its executable .jar is opened manually, it re-opens itself inside the operating system's shell console. The purpose of this is to have a C#-style console application ...
potato's user avatar
  • 1,122
1 vote
2 answers
717 views

Drawing graphics and text using macOS Core Graphics

I have a small python project, which draws graphics and text onto a graphics context using MacOS's Core Graphics APIs. The idea is to make it easy for the user to write a few short lines, in order to ...
benwiggy's user avatar
  • 113
1 vote
1 answer
31 views

Mac Bash: how to combine the open and str subtract to one line code? [closed]

new to bash , I use the following code to open the super folder with a file path. function openUp(){ cd $(echo $1 | sed 's@\(.*\)/.*@\1@' ); open .. } like ...
black_pearl's user avatar
8 votes
4 answers
3k views

Reporting new USB storage devices on Linux and macOS with Python

Synopsis: I wanted something for macOS (and Linux; maybe eventually Windows) that would simply wait for the user to connect a storage device and automatically select, or otherwise output the ...
voices's user avatar
  • 767
7 votes
1 answer
10k views

File path unified in Windows/MacOS/Linux

We are all tremendously happy about back slashes in Windows file systems and do not think that their sole purpose is to make life complicated for smart people who are capable of using different OS. ...
Dmitry Nogin's user avatar
  • 6,121
4 votes
0 answers
105 views

appleseed command line widget (CLW)

─── appleseed on GitHub appleseed v1.0.0 is a command line widget (CLW), I designed for macOS and iTerm2. Its a flexible platform for process automation and added eye candy. It utilizes ...
Matt's user avatar
  • 143
2 votes
1 answer
95 views

Check SMART status on MacOS and pop up alert

So I don't know much about bash scripting. I am just a beginner. I made this script which checks the SMART status of my root volume and if it is failing then it immediately throws a pop up alert if ...
Doe's user avatar
  • 21
3 votes
2 answers
81 views

Password string generation

I'm trying to create passwords using the following snippet to match a custom password policy. I've added three gtr statements, at the end of the string, to ...
TheAuzzieJesus's user avatar
4 votes
2 answers
748 views

A C++ wrapper for Apple CoreFoundation

The wrapper makes it easy to manage memory when using CoreFoundation objects. It aims to act like a simple shared_ptr. Here is a usage example: ...
Ben-Uri's user avatar
  • 143
8 votes
1 answer
92 views

Spoofs MAC Address to manufacturer of user's choice, Linux or MacOS

I've made a BASh script for Linux/MacOS that allows you to search for a MAC manufacturer and then generates a MAC address from that company and then spoofs it to that using ...
anonymous's user avatar
  • 203
7 votes
2 answers
281 views

Script to temporarily drop admin privileges

Description The aim of my project is to allow administrators to drop privileges for reasons of self-control. Currently, it works only on MacOS Sierra but the concept should be extensible to any Unix ...
Miheer's user avatar
  • 121
2 votes
0 answers
417 views

Find MIDI devices with certain names and make them usable

I'm working on a Swift app for macOS, where I take input from MIDI devices and transform that input. The MIDI devices being supported come in for flavors. What my code does is scan for MIDI devices, ...
Wesley Peeters's user avatar
4 votes
2 answers
73 views

Create and open a file to take lecture notes depending on day and time

I am just wondering what, if any, more elegant ways might exist to write a script to accomplish the task that the script below accomplishes. The script works, so I don't need it to be debugged, but I ...
dlk0606's user avatar
  • 43
6 votes
1 answer
165 views

Bash manual page selection menu (version 3)

This is an interactive script for selecting and reading the manual pages from the terminal command line. This is the 3rd version of this script. If you want to see the evolution of this script, follow ...
I0_ol's user avatar
  • 443
6 votes
1 answer
64 views

Bash manual page selection menu (version 2)

This is update to a previously asked question Bash manual page selection menu. This script generates a menu for the user to select which manual page he/she would like to read. ...
I0_ol's user avatar
  • 443
6 votes
2 answers
140 views

A replacement for OSX's path_helper

I was having problems setting my path the way I wanted, I turned to Apple's path_helper but found it appends system dirs to the beginning of the path. I found someone had made a start on a replacement ...
ian's user avatar
  • 240
4 votes
1 answer
75 views

Selective Time Machine backup deletion

Time Machine is a useful backup service for Mac, but deleting multiple backups is cumbersome. This script allows mass deletion of unwanted backups while allowing specified "important" backups to ...
kevinhilt's user avatar
2 votes
1 answer
3k views

Listening to IOKit events with Swift 3

This is my first program in Swift/Xcode. The full source code and xcode project is available in GitHub. The part I would like reviewed is IOKeyEventMonitor.swift. ...
Jean's user avatar
  • 528
2 votes
1 answer
120 views

Random password generator sh script

Yesterday, I was bored and decided to write a random password generator. At first it used numerous temporary files, changed that by using arrays. This was written on OS X and should work on Linux ...
chris's user avatar
  • 85
11 votes
4 answers
542 views

Simple CodeReview Questions Notifications for OSX

Some days ago, I figured out that I'd like to get a notification every time a new question is asked here. So, I've made a really simple Python script, which uses ...
Grajdeanu Alex's user avatar
5 votes
2 answers
1k views

Mounting a disk with the DiskArbitration framework

I have the following code that makes use of the DiskArbitration framework to mount a disk to its default location: ...
jviotti's user avatar
  • 151