Reduce Transparency In Mac through Terminal - objective-c

I'm trying to make an app that will disable/reduce transparency in Mac OSX like in the system preferences accessibility tab, using terminal. I want to use the system() command. I've found this command:
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
But unfortunately this is only for the menu bar and not for the entire system, can someone tell me a command to disable/reduce all transparency throughout all of OSX? Thanks.

You can set it for a user with this:
defaults write com.apple.universalaccess reduceTransparency 1
I couldn't find a way to set it system-wide.

Related

Developing task switcher, code changes not reflected on Alt+Tab

I'm developing my own task switcher in QML. When I change the code (main.qml) and press Alt+Tab, the KDE task switcher stays the same even if its preview from the System Settings shows the changes. The task switcher gets updated only after the next login.
I use Kubuntu 22.10, KDE 5.26.5 and my Task switcher is in ~/.local/share/kwin/tabbox/ folder.
Is there a way to apply QML code changes or to notify KDE about the source code being modified? Or is there another way to develop a task switcher (not invoking it by Alt+Tab)?
I tried removing qmlcache rm -rf ~/.cache/*qmlcache*, but it didn't help.
Restarting KWin should work: kwin_x11 --replace (if you're on X11; afaik it's not possible to restart the window manager on Wayland).
You can also try qdbus org.kde.KWin /KWin org.kde.KWin.reconfigure.

Macos Ventura Disable Three Finger Tap Gesture

How can I turn it off programmatically when the trackpad settings are set to "Tap with Three Fingers" in Macos Ventura operating system?
Option 1:
Option 2:
I tried the following defaults write commands but the changes are not applied without restarting.
I also try killall Dock and killall cfprefsd but it doesn't work.
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture -int 0
defaults write NSGlobalDomain com.apple.trackpad.threeFingerTapGesture -int 0
defaults -currentHost write NSGlobalDomain com.apple.trackpad.threeFingerTapGesture -int 0
Do you have any suggestion for a solution for this problem?
Without restarting the computer, I activated the defaults with the code below.
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u

How to run a script from startup on Raspbian 10 (buster)?

I have designed a GUI that I want to run as soon as I turn on my Raspberry Pi. It is currently set up to automatically log in as user on startup, but if that makes the process more difficult I can change that. My Raspi runs on Raspbian 10 (buster), which has made things difficult since I can only find tutorials for Raspbian 8 or so.
I have tried modifying autostart folder, but it is not in the same location as it was in previous Raspbian versions and doesn't seem to be working the way it used to. Tutorials have said to create a .desktop file in /home/pi/.config/autostart but I don't have a .config folder, or at least it's hidden. For me, autostart is in /etc/xdg/autostart and when I try to create a new file here using nano in the terminal, I get the message [Directory '/etc/xdg/autostart' is not writable] and it doesn't save my file.
I have also tried calling my script in /etc/rc.local but it did nothing. Some have said it doesn't work for GUIs.
Here's what I type into terminal:
$ nano /etc/xdg/autostart/gui.desktop
and a new file pops up, but at the bottom I get the warning [Directory '/etc/xdg/autostart' is not writable]
How can I get my GUI script to run on startup with Raspbian 10 (buster)?
There are a number of issues here, first when you are looking at tutorials recognize that Linux distros are built in layers, for simplicity let's say your "layer stack" looks like this: kernel, systemd, x11, xdg, lxde. The kernel boots, then starts systemd, which then starts x11 (and a lot of other stuff), x11 starts xdg (and some other stuff, I think), lxde is started by either x11 or xdg I'm not sure which.
You want to add something to this process, you can do it at the kernel level (bad idea), at they systemd level (probably not right unless its a daemon), at the x11 level (still probably bad as you still don't have a user session yet), or at the xdg or lxde level.
xdg is probably the right place as it has all you need ( a gui, a user session) while being common (xdg will still work if you switch window managers, probably)
With that out of the way, why isn't your solution of modifying xdg working? It's because '/etc/xdg/autostart' is a system configuration directory. Any changes made to it will apply to all users. You may want this, but the system is trying to protect other users on your system and only allows root to make changes to everyone. If you want to do that use "sudo" (documented elsewhere on stack exchange and the internet). If you want to do it just for you use ~/.config/autostart, (https://wiki.archlinux.org/index.php/XDG_Autostart) you might need to create that directory with "mkdir ~/.config/" and then "emacs ~/.config/autostart"
Would it be better to have the python program run in a terminal window from startup? That way you would see what it is doing in case of errors.
If so, perhaps check this out https://stackoverflow.com/a/61730679/7575617
By the way, in the file manager, hit CTRL+H to toggle viewing hidden files and folders.

Use dolphin (or other browser) like yakuake

I often want to open a file browser to open a file and then close the browser.
Is there a way (a plasmoid, a dolphin plugin, another browser...) which could allow me to have a file browser "in the style of" yakuake? (i.e. unfolding with a shortcut, and re-folding when I chose the file I want)
Took me some time, but finally managed to get what you want (and eventually, what I also want :) with xdotool (on Ubuntu sudo apt-get install xdotool).
With this script, you can have any application behave like you asked:
#!/bin/bash
SEARCHED_WINDOW=$1
COMMAND=${2:-$SEARCHED_WINDOW}
SEARCHED_WINDOW_CLASSNAME=toggleApp$SEARCHED_WINDOW
WINDOW_ID=$(xdotool search --classname $SEARCHED_WINDOW_CLASSNAME)
VISIBLE_WINDOW_ID=$(xdotool search --onlyvisible --classname $SEARCHED_WINDOW_CLASSNAME 2>/dev/null)
if [ -z "$WINDOW_ID" ]; then
$COMMAND 2>/dev/null &
pid=$!
NEW_WINDOW_ID=$(xdotool search --onlyvisible --sync --pid $pid 2>/dev/null)
xdotool set_window --classname $SEARCHED_WINDOW_CLASSNAME $NEW_WINDOW_ID
xdotool windowfocus $NEW_WINDOW_ID
elif [ -z "$VISIBLE_WINDOW_ID" ]; then
xdotool windowmap $WINDOW_ID
xdotool windowfocus $WINDOW_ID
else
xdotool windowunmap $VISIBLE_WINDOW_ID
fi
(Inspired from here)
You call it like this:
./toggle.sh dolphin
If the command to launch the program is different, you can add a second parameter:
./toggle.sh appName commandToLaunchApp
What this script does is the following:
If the app is not running: launch it, give window a specific class, and give window focus
If the app is running but with no visible window: make window visible and give it focus
Else, i.e. app is running and visible: hide it.
All you have left to do is map a shortcut to the above-mentionned command to launch the script. In KDE : System settings > Shortcuts and gestures > Custom shortcuts. Then Edit > New > Global shortcut > Command.
Plus, this script works with any app, should work with any EWMH compliant window manager, and allows you to have other instances of the same app (this is why I added the class trick).
The closest solution to what you want is the Widget Layer Compiz plugin.
This plugin enables you to make appear a layer on top of your workspace. You can configure this layer to hold windows of your choice, in your case that would be the file manager. It has a hide/show feature which you can bind to a hotkey.
It uses Window Matching rules to define the windows to hold.
More information on http://wiki.compiz.org/Plugins/Widget
However, this would imply that you use the Compiz compositing manager.

Computer overriding autorun behaviour of CD?

I'm hoping this isnt too much of a problem, but I want to make sure.
I'm creating an autorun CD that when put in, will launch a Flash Video with links for customers to navigate through.
I've created my autorun.inf file in the root directory of the CD with the following info in it:
[autorun]
open=catmenu.exe
However, when I try and run the file on an other computer I still get the options screen 'run program or open to view files'. If I click 'run program' then it launches like normal. I think this is just the computer overiding the autorun feature, but I've never made a CD before so I cant be sure. Is there a way to bypass this 'run or view' option or is that just the way it is?
The autorun is determined by the operating system. For Windows 7 as an example - you can go to the Control Panel | AutoPlay and change the settings for each type of media (software, music, video). It is generally safest to work with the "Ask me" option or "Take no action"