2

How you can make changes take effect and update in the Preferences GUI immediately without having to reboot (unacceptable), log out (bad) or kill processes (last resort)? macOS 10.12

defaults write ~/Library/Preferences/.GlobalPreferences.plist com.apple.swipescrolldirection -bool NO
sudo defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.plist LocationServicesEnabled -bool NO

Update:

  • Restarting Finder updates swipe GUI, but not the swiping itself! How can this be done?
  • Location services: Updates instantly now. (Must have been something wrong before.)
  • I think you need to restart the "finder.app" for any UI changes to take place. – user136952 Jan 5 '18 at 21:01
  • Please edit your question to indicate which version of macOS you are running. – IconDaemon Jan 5 '18 at 22:09
1

Send the System Preferences process a signal called the 'hang-up' or HUP, also known as signal number 1 as defined somewhere in a system signals.h header file. POSIX convention, I believe.

The quick and dirty:

sudo pkill -1 'System Preferences'

Replace System Preferences with Finder, or the PID of a relevant process. Another quick and dirty:

for STALE in Finder Preferences locationd ; do sudo pkill -1 $( pgrep ${STALE} ) ; done

What a HUP signal should effectuate in the receiving process is an internal halt and re-evaluation, which usually includes a re-reading of any relevant config files. The process will not terminate, only 'refresh' itself.

Hope this helps.

F.

  • Interesting! I have never heard of this before. Did you try that it's working as described, ie. re-reading configuration without terminating? (Also, what is the scope of this practice? Is it something that applies for many/most Linux/Apple apps?) – forthrin Sep 14 '18 at 12:44
  • My friend, if memory serves me well, signals were standardized across all UNIX platforms under one of the POSIX standards, a long time ago. It is convention and expected behavior that a process re-evaluate its configuration files upon receiving a HUP signal. I have not tested this on Mac OS, yet the shell code is valid and works to send HUPS to the Finder, locationd, and Systems Preferences. F. – Francis from ResponseBase Sep 14 '18 at 15:49
  • Thanks for clarifying with some background. I will test this upon next chance! – forthrin Sep 14 '18 at 15:52
  • The fact that I am familiar with the POSIX conventions is merely a testament to my old age and relevant experience... ;-| – Francis from ResponseBase Sep 14 '18 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .