useless CloudFoundry CLI color scheme on mac - color-scheme

I recently updated to CloudFoundry CLI 6.18.0* - since then the outputs have a "very hard to read" color scheme on my mac (OSX, El Capitan).
I know I can disable it with CF_COLOR=false, e.g.:
CF_COLOR=false cf logs myapp
But is there any way I can define a more user-friendly color scheme?

It would be better to raise this as an issue in the CF CLI GitHub repo. Does this issue match what you are seeing?
Unreadable text when using light background terminal
If so, you can add a comment to that issue.

The next release (v6.21.0) will revert the color used in cf help (section headers) and cf logs that are hard to read on light colored terminal backgrounds back to what they were in v6.14.0 and before - Not an answer to how you can define a custom color scheme, but hopefully it takes away the need for that.

Related

(Monogame) Keyboard input not being recognized

Just got into monogame today. Noticed that my software wasn't taking any keyboard inputs when I tried to bind a key to a fullscreen toggle. Weirdly enough, it takes inputs from my controller just fine, but just not the keyboard. Keyboard.GetState().GetPressedKeyCount() also always returns 0, so I've got no idea what's causing the problem.
I'm not usually one to attach full code files, but the program loop class is only 72 lines, so it's here if it helps: https://pastebin.com/xcWnDvqL
Platform: Windows 10 Build 19044
Monogame Version: 3.8.0.1641 (DesktopGL)
I tried to set up my project the same way as you did, but I am unable to reproduce the issue. It probably has something to do with your system. You can try the following and see if it works for you.
Now this may sound silly, but when you provide input, are you sure the window is active?
Your game can detect input from the gamepad even when the window is inactive, but the same is not true for keyboard input. I noticed this while testing your program. So ensure that the window is active (by clicking on your game window) before pressing a key and see if the game is still unable to detect input.
I hope that this is the problem in your case. If not try the other fixes as shown below.
Update the Monogame packages.
The latest version of monogame available is v3.8.1, so you can update your templates.
Proceed to install the latest nuget templates (as it was mentioned by Monogame that many bugs have been hotfixes in this version. You can do so by doing the following in a terminal.
dotnet new install MonoGame.Templates.CSharp::3.8.1.303
Then proceed to make a fresh desktopgl or mgwindowsdx project and see if the issue persists.
Check for driver issues.
Monogame uses xinput/DirectInput(a package in DirectX) to detect input from the input devices. Maybe the issue has something to do with it. You can search and run dxdiag from the start in windows. Ensure your drivers (including video drivers) are up to date.

Windows 10 / 8 start menu tile icon size for classic WPF desktop applications

I'm actually wondering how you can control the icon size (or generally: which icon to use?) for a 'classic' WPF application appearing in the Windows 10 start menu as a tile shortcut.
I only found very few posts like this one on SO, but the only answer one gets is that the corresponding mechanisms are only implemented for 'modern' Windows apps. This may be true in terms of live tiles and manifest-based definitions.
However, there has to be a way of triggering 'bigger' icons. Specific example: I have built an WPF application that, when pinned to the start menu, only shows up with a small icon in it. This is the case for all 'classic' applications - see attached image of a shortcut to the 'Orca.exe' db editor. I do believe in a way to achieve bigger icons because I noticed the Mozilla Thunderbird application (which is a 'classical' application) shows up with this one (custom background color and big icon size).
Is there anyone who understands how to achieve this and may share his knowledge? I already extracted the used icons from executables/shortcuts and compared them, but both only provide standard icon sizes up to 256px, no difference there.
Thanks!
This is actually pretty simple, but I remember having a hard time myself finding the documentation (or realizing that this is perfectly working for 'classic' applications):
Reference: MS docs - How to customize Start screen tiles for desktop apps
You can control the described behaviour and appearence of start menu tiles with a xml file called [Software].VisualElementsManifest.xml, where [Software] has to be replaced by the name of the .exe file (without extension), e.g. thunderbird.VisualElementsManifest.xml. As you already mentioned it, you can peek into the Thunderbird folder for a working example of it's content. Basically it looks like this:
<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<VisualElements
ShowNameOnSquare150x150Logo='on'
Square150x150Logo='VisualElements\VisualElements_150.png'
ForegroundText="dark"
BackgroundColor="#FF0000"/>
</Application>
You can even provide additional options and assets for proper scaling, localization and accessibility by creating proper ressource files, documentation from MS has step by step instructions for this.
Note that the documentation warns about it's deprecated content. I don't know how long this work or if they are planning to completely remove this way of tile specification in the future, however it went perfectly fine on all version of W10 so far.
Note #2: If you're trying this out with an existing installation/shortcut, you have to refresh the modification timestamp of the corresponding shortcut and then unpin/pin the tile again, otherwise the shell won't notice the new definition file existance. Simplest way to do so in PS (run as admin when modifying shortcut in the system folder):
(ls "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\[ShortcutName].lnk").lastwritetime = get-date
or from CMD within the destination folder:
copy /b [ShortcutName].lnk +,,

How to run c code(on codeblocks) without desktop on raspberry?(Like work of omxplayer)

Sorry my bad English. I work 3d shape with opengl on raspberry pi3(debian) for a while. I want to run my code don't use on desktop(or window). I searched but puzzled my mind. In a nutshell I want to run my code as well as in image below.
enter image description here
When I searched this topic, I have seen about EGL library but I don't know if I can use this.
If you used OpenMAX library before you know openmax doesn't use window. All image or video can run on console mode. You don't need any dosktop. I wonder this Is there a way I can use Opengl in this way ?(Can Opengl run like OpenMAX library or not) If there is any way How should I build my code ? I want render my image without desktop. I want use console mode.
Thanks your time. Best Regards.
The most straightforward solution would be to just create a fullscreen window, that has no border and no decorations (titlebar, buttons, etc.). If you want actual graphic output, there's nothing wrong with using X11. Despite some hearsay thrown around on the Internet the Xorg X11 servers are actually pretty lightweight.
If you really want to go without X11, then you should look at things like the kmscube demo https://cgit.freedesktop.org/mesa/kmscube/tree/ which does OpenGL directly to the display, without a graphics server or windowing system in between.
If you want it to be a little more abstracted, then have a look at how Wayland compositors talk to the display. The developers of the Sway Wayland compositor developed a nice abstraction library for this: https://github.com/swaywm/wlroots
You need to start display server first.
What you need could work with "xinit" which would manualy start xorg server, after that I suspect you should start "openbox" which is window manager. This way your desktop application should run as is, no changes needed.
Best practice is to create shell script for starting your application which could look like this:
set -e
xset s off
xset -dpms
xset s noblank
openbox &
cd /home/your_applicaton_directory
your_executable 2>/dev/null >/dev/null
Save this script and mark it executable whith
chmod +x
Then try to run this:
xinit /full_path_to_above_script
Hope this helps a bit... :)
Qt has a platform backend called eglfs, which lets your application run fullscreen on a single screen by using EGL and kms with very little overhead. Should work nicely with whatever OpenGL stuff you want to do.
You would just program a Qt application like normal, and launch it with ./myapp -platform eglfs from a tty.
http://doc.qt.io/qt-5/embedded-linux.html#eglfs

Some applications render black frames WPFMediaKit

I have a very weird bug that I just can't understand.
I am currently using the WPFMediaKit library in one of my programs.
When using the library in a near empty new "demo" wpf solution, the image from the USB Camera source is rendered perfectly to the MediaCaptureElement class.
However, using a more complex solution, the same library (without changes), the frame gets rendered black. I can see there is connection to the camera and everything goes well, DirectShow graph is built normally and everything just looks fine, besides the black frames. I can even open the camera properties and see it pushing out frames as usual.
Also, this only happens on Dell E6540 (With an AMD and Intel HD gpu) if it's Windows 7. Windows 8/10 work fine. Have tried a lot of drivers nothing seems to change the output.
I have no clue what to do or what to try.
After many hours and just after deciding to post this question, I found the answer.
The more complex solution, under the AMD Settings application was set to use "High Performance" mode, this mode was automatically enabled on Windows 7 for some reason. Disabling that and setting it to "none" or "lower power" fixed the issue.
Doesn't change the fact that there is an issue with laptops with dedicated AMD GPUs, probably something to do with DirectX/Direct3D which is used to render the frames.

Notification in screen corner

I need to create a small notification in the right-bottom corner of the screen. It should provide the following functionality:
Should NOT change the current focus.
Should allow me to put some text in it.
Should appear (and stay if possible) on top of all windows.
Can you suggest using something? The less installing required the better.
Well, there are a few ways to do it.
Roll your own
Use the infrastructure of the desktop environment
Naturally, #2 is going to be more reliable — if you know what the desktop environment you're targeting is.
You mention Linux, so let's look at Gnome. The two most popular (?) Linux-based operating systems are the Red Hat/Fedora/CentOS family and Ubuntu, both of which are based on Gnome 3.
Gnome 3's Notifications;
Do not change the keyboard focus
Allow text (and more)
Appear for a moment above other windows, but then tuck away at the bottom of the screen after a bit; but, can be called back up by mousing over their icons.
Plus, there's nothing to “install” — unless you're running an unusual build, the stock distributions all include the Notification support you want already.
The documentation is found on the Developer.GNOME.org web site, here.
If you are not running on a “normal” Linux distribution, you still have options.
Install libnotify, and enough Gnome infrastructure to let it work.
Re-inventing the wheel…
In the latter case, you'll want to:
Create a top-level X Window;
Set flags on it to ask the Window Manager to please* keep it on top, not decorate it
with the usual resize and title decorations, and so forth;
and set up its contents on your own.
Some documentation on providing hints to the window manager can be found on FreeDesktop.org.
*- the window manager, however, is free to ignore your hints, if it chooses.

Resources