Brightness and volume key bindings not working in dwm - config

I'm trying to get my volume and brrightness keys to work using dwm.
I put this into dwm/config.h: https://imgur.com/IG6Qgpb.png
And also this for the keybinds.
https://imgur.com/yWfdtfV.png
So far I've tried this in my command line
sudo make uninstall
sudo make install
Then I tried to do the same in root, but that didn't change anything either
I also killed xsessions and booted everything up again and it still doesn't seem to be changing anything.

You probably forgot to import XF86keysym. You can do that by pasting #include <X11/XF86keysym.h> on top of your file. I'm no C pro but I was able enabling my volume and brightness keys using this gist. After that import your keys will probably work.
If you are a laptop user and have no dedicated keys for sound/brightness you have to make sure your FN + F1-F12 (whatever your brightness/sound controls are) are reported as XF86XK_AudioLowerVolume, XF86XK_AudioMute, XF86XK_AudioRaiseVolume and their corresponding brightness XF86 codes. I did that myself using this post.
For checking your key clicks and what the codes are you can use utilities like showkey (hint: use showkey -a or sudo showkey -k). Or check this thread.

Related

How to select session M-a in tmux using keyboard

In tmux I have multiple sessions running. To switch sessions, I hit my tmux escape sequence and then the s key. The session list appears:
Now I can hit the key 4, for example, if I want to go to session blacklist.
I want to go to session g-orchestrator. Without using the arrow keys, what key combination can I hit to enter that session?
M-a means "Meta-a", which is usually Alt-a in most terminal programs (in Apple's Terminal.app you must enable the app preference "Use option as Meta key" before this will work). So, in this case, the key combination Alt-a will take you to that session directly. Additional sessions will be reachable via Alt-b, Alt-c, Alt-d, etc.
I am using iTerm2.
What did not work for me on iTerm2
Using the "Meta" setting for the left or right option key.
What worked for me on iTerm2
Holding down the escape key and hitting "a". Although weirdly enough it doesn't work consistently. Sometimes I have to release the escape key and do it again a second time.
Using the "Esc+" setting for the left or right option key. Then for example I hold down the option key and hit "a". This seems to be working fairly reliable. The setting is under Profiles > Keys > Left Option key / Right Option key, and I include a picture below:

How to enable the experimental AAC encoder for VLC and record AAC sound from the microphone?

I managed to record mp3 with VLC 2.1.5 on MacOSX 10.9.2 by using this command:
./VLC -vvv qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{acodec=mp3,ab=128}:standard{access=file,mux=mp3,dst=~/Desktop/Recording.mp3}"
However I need to record AAC audio and every time I use the AAC settings, the file is 203 bytes and broken, probably only the header gets written. Some mux/filetype combinations produce 0 bytes files or don't produce any file at all.
I used this command:
./VLC -vvv qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=ts,dst=~/Desktop/Recording.mp4}"
Any command that works and records AAC audio with VLC from the Terminal would be greatly appreciated. Thanks!
Update:
I managed to get it started with this command:
./VLC -vvv qtsound://Internal\ microphone --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst=~/Desktop/Recording.mp4}"
But when it tries to encode it tells this:
[aac # 0x10309e000] The encoder 'aac' is experimental but experimental
codecs are not enabled, add '-strict -2' if you want to use it.
[0x100469c30] avcodec encoder error: cannot open encoder
So it looks like I should add this
-strict -2
parameter to the command to fix it. Unfortunately this parameter is for ffmpeg and VLC does not recognize it. Do you have any idea how to enable the experimental AAC encoder for VLC?
Had something similar - Have no idea if this is doing anything, but it did make the error go away. Basically tried to pass params to ffmpeg
#transcode{aenc=ffmpeg{strict=-2},vcodec=mp4v,vb=1024,acodec=mp4a}
Hope this gives you some ideas
Another way this seems to work is with the --sout-avcodec-strict switch to the vlc command itself. To modify the original example:
./VLC -vvv qtsound://Internal\ microphone --sout-avcodec-strict -2 --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst=~/Desktop/Recording.mp4}"
FYI, on Windows systems, one needs to use an equals sign for option values (not a space), so it would be --sout-avcodec-strict=-2 instead there.
I don't know what the difference is between these two forms, or indeed, if there is one. I suspect the sout-avcodec-strict form might be more robust in the face of future changes to the codec library interface, but given that it's a library-specific option in the first place, I'm not sure that matters.
My info was from:
https://forum.videolan.org/viewtopic.php?t=111801
Hope this helps.
Yes, huge thanks all the tech dudes here! Would just add that getting VLCs mp4 transcode working is also a great solution when Windows Movie Maker rejects (="is not indexed and cannot be imported") all your perfectly functional .asf / .wmv / .avi files. Install the K-Lite free codec pack to fundamentally broaden Movie Maker's import abilities; access these by switching to "All files" in the import dialogue; then stare in amazement as an (mp4) video actually loads!
For the graphically oriented, I've compiled screenshots of the various boxes, including that all-important strictness = -2. To use, Control R (=Convert...); browse to input file; [build, save &] load profile; browse to output location & supply name; finally hit Start (green ringed).
My setup is Windows 8.1, Movie Maker 6, K-Lite Codec Pack 12.0.5 (Full), VLC 2.2.1
Peace+love, AK
VLC makes mp4, now with sound!

Multiple SSH public keys into a single file

I'm trying to sftp to a host which acts as a load balancer and routes to 3 other systems based on round robin.
Our public key is setup on their systems. Yet, when ever I try to connect, I get prompted with a "Man in Middle attack" message asking us to verify the key finger print. To over come this I tried adding their public host key into .ssh2/hostkeys/key22_22_hostname.pub file.
Problem is I can't add 3 keys into this file, it seems to accept only one key?
Any suggestions on how to overcome this issue or add 3 public keys into one key22_22_hostname.pub file?
This is on AIX system.
How about cheat and copy the one system's keys to the others? I know is sorta scummy but in this case, it might be appropriate.
I believe those keys are found in /etc or maybe /etc/ssh.

VB.NET - Set windows to control/manage wireless over third-party clients

Within VB.NET, trying to find an easy way to in a sense check the check-box "Use Windows to configure my Wireless Network Settings". This is an option that forces windows to use your wireless over third-party programs that may try to steal control. I am aware this requires to have WZC enabled within services and that's something that can be easily accomplished one way or another.
I doubt or rather cannot find a proper registry value or API call to check or initiate such a task.
I would use a registry-recorder to record the changes when manually changing the value, then its a piece of cake to implement the register change in code.
There are plenty programs that can be used to see what changes has been done in the registry, here are one free: http://www.kephyr.com/systemsherlocklite/index.phtml, but google may find more or better variants out there.
With this tool, create a registry dump:
systemsherlock.exe -dump d1.dat -regdirs HKEY_ROOT
Do the change in the wireless network settings
Do a new dump of the registry:
systemsherlock.exe -dump d2.dat -regdirs HKEY_ROOT
And last, compare them and see what has changed:
systemsherlock.exe -compare d1.dat d2.dat

Mac OS X: Getting detailed process information (specifically its launch arguments) for arbitrary running applications using its PID

I am trying to detect when particular applications are launched.
Currently I am using NSWorkspace, registering for the "did launch application" notification. I also use the runningApplications method to get apps that are currently running when my app starts.
For most apps, the name of the app bundle is enough. I have a plist of "known apps" that I cross check with the name of that passed in the notification.
This works fine until you come across an app that acts as a proxy for launching another application using command line arguments.
Example: The newly released Portal on the Mac doesn't have a dedicated app bundle. Steam can create a shortcut, which serves as nothing more than to launch the hl2_osx app with the -game argument and portal as it's parameter.
Since more Source based games are heading to the Mac, I imagine they'll use the same method to launch, effectively running the hl2_osx app with the -game argument.
Is there a nice way to get a list of the arguments (and their parameters) using a Cocoa API?
NSProcessInfo comes close, offering an `-arguments' method, but only provides information for its own process...
NSRunningApplication offers the ability to get information about arbitrary apps using a PID, but no command line args...
Is there anything that fills the gap between the two?
I'm trying not to go down the route of spawning an NSTask to run ps -p [pid] and parsing the output... I'd prefer something more high level.
You could use whatever ps uses, though it isn't cocoa based. According to Singh, ps is based on kvm and sysctl calls. Pouring over the source, the pertinant calls seem to be kvm_openfiles, kvm_getprocs and kvm_getargv. To get the command line arguments, first call kvm_openfiles to get access to the kernel memory space, then use kvm_getprocs to get kernel process info, then kvm_getargv.
The use of sysctl in ps seems less relevant to your goal; it's used to get other information, such as the group ID and parent proces ID. The particular sysctl name used is {CTL_KERN, KERN_PROC, KERN_PROC_which, flags}, where which specifies a process filter (e.g. ALL, PID) and flags are arguments for the filter (the details are in the sysctl man page).
OS X doesn't have support procfs, but Singh developed a FUSE based version, released under GPLv2. If you bundle it with your application, you'll have to release it under GPLv2 as well. Most of MacFUSE is released under a BSD-style license, so it can be distributed with your app without making it open source (fusefs/fuse_nodehash.c is released under Apple's open source license, but it also allows linking to closed source apps).
The question "Get other process' argv in OS X using C" should be of use, as it has sample code using kvm and sysctl. TN 2050 "Observing Process Lifetimes Without Polling" may also be of use to you.
Nope - running ps is your best bet. Standard process info interfaces aren't supported on OS X (noop versions were provided in OS X 10.4, but removed thereafter) and the private interfaces are likely to change between OS X revisions.
If you're willing to lock yourself into a single OS X version, all the source is available, for example for ps or libproc; you'll also need to run as root.