invert colors of application in X11 - x11

I am aware of inverting X11 window using the following command
xcalib -invert -alter
However, I could not find a command for inverting the colors of an individual application.
I tried inverting the colors of an application by running the application inside Xephyr or Xnest and trying to run xcalib command inside of that, but it failed stating:
DISPLAY=:1 xcalib -invert -alter
Xlib: extension "XFree86-VidModeExtension" missing on display ":1".
Error - Unable to query gamma ramp size
Then I learned that Xnest can be started with XFree86-VidModeExtension, and tried the same as follows:
Xnest -ac -br +extension "XFree86-VidModeExtension"
Then I tried xcalib -invert -alter command on the display :1 again. It failed
I am running the ubuntu VM inside Virtualbox and running dwm window manager in it
Is there any way to run xcalib inside a nested X

compiz can invert colors of individual windows.

Related

Multiple problems installing TeX Live 2021 on Windows 10

I have a Windows 10 laptop where no TeX distribution was ever installed before (double-checked for config directories, files, and environment variables).
Wanting to install TeX Live 2021, I followed the full installation guide and also read the Windows-specific warnings. I've now tried several times, following different installation procedures - cleaning up everything (deleting base & user directories, environment variables, etc) before each time - but still don't manage to get a working installation. Before I report a bug at tex-live#tug, I wanted to ask for advice here, in case I'm doing something wrong. Here is what I did, step by step, and the problems I encountered in the process.
1. First I tried running the recommended online installer install-tl-windows.exe. It never got past the screen that tries to contact or load from a repository, even after a 30-min wait. Tried a dozen times, choosing different mirrors nearby and far away. No luck.
2. Then I downloaded and unpacked the install-tl.zip and run install-tl-windows.bat therein. This time the main installation window appeared. I left all default paths and environment variables (note that I do have write access to C:); in the selection scheme I unselected all languages except US & UK English, unselected XeTeX, LuaTeX, ConTeXt; also unselected TeXworks (I use Emacs), and clicked Install. After one to three hours (depending on the mirror I chose), the installation was complete.
I tried compiling a minimal latex document (see below), and got an error similar to the one in this old question:
I can't find the format file `pdflatex.fmt'
Following the advice in the answers to that question and similar questions elsewhere online such as this, I tried running texhash and fmtutil-sys --all. The latter gave the error
no appropriate script or programme found fmtutil.
for which there are also many posts online.
2a. Not understanding what the problem could be, I re-tried with all possible combinations of the following three options: (a) choosing different mirrors; (b) leaving the full selection of packages (ie without unselecting some languages, LuaTeX etc); (c) redoing the procedure by choosing "Run as Administrator". No luck.
3. At this point I tried downloading the ISO file with the full installation. Mounted the image and run install-tl-windows.bat (as normal user, as recommended; I repeat that I do have write access to C:). Everything proceeded as in step 2. above. At the end of the installation I tried running pdflatex on the minimal latex document. New error this time:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./minimal-template.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
! LaTeX Error: File `article.cls' not found.
Very strange. A file search revealed that article.cls is in the TeXLive file system; but kpathsea did not see it indeed.
4. At this point I opened the TeX Live Shell from the Start Menu; selected a CTAN mirror; updated the TL Manager which was not up to date; updated all packages; run Regenerate filename database; and run Regenerate formats. With the latter I got this error:
tex live shell:
mtutil [INFO]: total formats: 59
fmtutil [INFO]: exiting with status 53
C:\texlive\2021\bin\win32\runscript.tlu:915: command failed with exit code 53:
perl.exe c:\texlive\2021\texmf-dist\scripts\texlive\fmtutil.pl --sys --all
Here is a snip from the full set of errors appearing in the "Other" tab (I'm replacing my user directory with asterisks for privacy; note that I do have write access to these directories):
start load https://www.nic.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet
finish load https://www.nic.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet
start load http://contrib.texlive.info/current
finish load http://contrib.texlive.info/current
running mktexlsr ...
done running mktexlsr.
running mtxrun --generate ...
done running mtxrun --generate.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in C:/texlive/2021/texmf-dist
running fmtutil-sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX ...
tlmgr.pl: fmtutil-sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX failed (status 255), output:
Unknown option: status-file
Try "fmtutil --help" for more information.
C:\texlive\2021\bin\win32\runscript.tlu:915: command failed with exit code 255:
perl.exe c:\texlive\2021\texmf-dist\scripts\texlive\fmtutil.pl --sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX
running fmtutil-sys --byengine luajithbtex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=C:\Users\***\AppData\Local\Temp\rPSb0Dpak2\WW_dJvUHgX ...
I tried to continue anyway with Regenerate fontmaps, and then tried again pdflatex on the minimal document. New error:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
---! c:/texlive/2021/texmf-var/web2c/pdftex/pdflatex.fmt made by different executable version
(Fatal format file error; I'm stymied)
5. I tried again steps 3. and 4., but with "Run as Administrator". Same errors.
OK at this point I give up and really don't know what to do. Am I doing something wrong? For the moment I have to concur with this post: installation of TeX Live 2021 is an utter failure.
Here is the minimal latex file I used for testing (copy & paste):
\documentclass{article}
\begin{document}
test
\section{Section}
test
\end{document}
Found, that the download is not working because the system path to "cmd.exe" is not found. Therefore: open a cmd window and add the system path prior to starting the .bat file (set PATH=%PATH%;C:\Windows\system32)

Distracting Exception output in QtCreator when debugging Windows application

I am using QtCreator 4.1rc1 under Windows with the msvc tool chain. The debugger is cdb from the Windows 8.1 SDK. I had the same issue with older versions of QtCreator.
When I debug my application, then there are many messages to the output (and issues) pane in the form
Exception at 0x773596c2, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in WinSCard!SCardTransmit
I understand, that this is to be expected under Windows and those exceptions are actually not a problem. But they pollute the output and issues pane and basically render them useless.
So I tried to get rid of the messages. But failed after hours trying. What I tried is the following:
Use the check box 'Ignore first chance access violation' under Tools->Options->Debugger->CDB
Specifying command line arguments to cdb.exe: -xi
Create a script file for cdb.exe to be used at startup to avoid the warnings. The script contained the commands 'SXI 8010000a; SXI 0000071a; SXI e06d7363'. I tried placing the script in several directories and also specifying it with the command line options -cf or -cfr.
When I run cdb.exe from a command line using the startup script, it works! No exceptions are printed to the console. But when I start it from QtCreator, they are there again.
I assume, that QtCreator is using their own startup scripts and those overwrite the ones I specified.
Has anyone succeeded in hiding those exception outputs under QtCreator with cdb?

How do I change window managers with Yocto Project tools?

My Intent
I have an image generated by BitBake on which I'm interested in changing the window manager to metacity or maybe something similar.
My Process
I've added require recipes-graphics/images/core-image-x11.bb into my core recipe, which provides a simple Matchbox terminal window but seemingly no other functionality. If I add matchbox-desktop and matchbox-session-sato, it adds a bit more usability but not what I'm looking for.
I've included the default package from the metacity_2.34.13.bb recipe from the meta-gnome layer from the OpenEmbedded Metadata Index in the IMAGE_INSTALL variable of my core image. This installs several components including a metacity command in /usr/bin. If I run that command, I get the following message:
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications
(metacity:1124): GLib-GIO-ERROR **: Settings schema 'org.gnome.metacity' is not installed
Trace/breakpoint trap
I've navigated to /usr/share/glib-2.0/schemas and run glib-compile-schemas ., then run:
startx
metacity --replace
again. Now, the output is:
Window manager error: Unable to open X display
I haven't found a clear solution to this error which applies to my specific situation.
Update (2/29):
I may have now found a solution to this error, using these commands:
X&
export DISPLAY=:0
metacity&
At this point, I seem to be running something on one of my VTs. I can run demos like glxgears in that VT (glxgears is included in the mesa-demos recipe), but I don't know how to actually create a usable environment.
My question(s)
I'm not using much from meta-openembedded/meta-gnome (just metacity) or meta/recipes-gnome (adwaita-icon-theme, gnome-desktop3, gsettings-desktop-schemas and gtk+3), so am I missing some recipe which automates the addition of metacity?
(if not Question 1) How can I solve the error Window manager error: Unable to open X display?
The x11-common recipe adds a X session script that will run /usr/bin/x-session-manager: that is responsible for starting your desktop environment.
The way to implement a new session/DE in OE-Core is to use update-alternatives for "x-session-manager": see the matchbox-session recipe for the default implementation and mini-x-session recipe for an alternative.
mini-x-session might be modifiable for your needs so you don't need to write a new one: A /etc/mini_x/session file like this might do the trick:
# start any apps here, e.g. "my-desktop &"
exec metacity
Going from this (a running window manager) to "usable environment" might still be lots and lots of work, depending on your definition of usable.

Tesseract "Failed loading language..." on windows cmd

Windows 7, Tesseract 3.02
All I'm trying to do is run "tesseract img.jpg img" from cmd.exe.
I'm running it from my C:\...\Tesseract-OCR directory.
But I get the error:
Error opening data file
C:\...\Tesseract-OCR\tessdata/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to
the parent directory of your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.
How can I fix this?
This problem has been brought up many times it seems (around the web), but no answers I've come across have done me any good.
I've tried doing "set TESSDATA_PREFIX=C:\...\Tesseract-OCR" but nothing changes.
Does it have to do with the reversal of the backslashes|forward slashes in the path?
Reinstalled.... works fine now :B
Correct Output:
Tesseract Open Source OCR Engine v3.02 with Leptonica

Aptana Studio 3 terminal strange indentation characters in Windows

I am using Aptana Studio 3 on Windows 7 to develop in Ruby. However when I try to use the built-in terminal to run commands such as rspec or git, I get strange characters instead of indentation. In the example below, everything works fine except for these weird characters. Actually the question mark characters appears as a left arrow in the terminal.
I've tried searching SO for [aptana] [terminal], but couldn't find anyone else who had similar issues. Does anyone recognize what is happening here?
Jake#JAKE-PC ~/My Documents/Aptana Studio 3 Workspace/user-service (master)
$ rspec spec/service_spec.rb
D, [2013-07-22T19:19:24.021708 #6564] DEBUG -- : env: test
D, [2013-07-22T19:19:24.080711 #6564] DEBUG -- : db/test.sqlite3 database connection established...
D, [2013-07-22T19:19:24.222719 #6564] DEBUG -- : fixture data created in test database...
service
GET on /api/v1/users/:id
?[32m should return a user by name?[0m
?[32m should return a user with an email?[0m
?[32m should not return a user's password?[0m
?[32m should return a user with a bio?[0m
?[32m should return a 404 for a user that doesn't exist?[0m
POST on /api/v1/users
?[31m should create a user (FAILED - 1)?[0m
Failures:
1) service POST on /api/v1/users should create a user
?[31mFailure/Error:?[0m ?[31mlast_response.should be_ok?[0m
?[31mexpected ok? to return true, got false?[0m
?[36m # ./spec/service_spec.rb:73:in `block (3 levels) in <top (required)>'?[0m
Finished in 1.2 seconds
?[31m6 examples, 1 failure?[0m
Failed examples:
?[31mrspec ./spec/service_spec.rb:67?[0m ?[36m# service POST on /api/v1/users should create a user?[0m
The weird stuff -- ]36m and the like -- that you are seeing are codes that should be changing the color of the type. rspec will show failed tests with red type, and passing information with green. The Aptana terminal is not able to handle these color codes, so you see the garbage (literal) characters.
Unfortunately, the issue has to do with how the eclipse for windows code is written, so if it were ever to be fixed, first the code in eclipse would need to be changed, and then the aptana code.
You can run a console (Windows Command) window in addition to eclipse, and run your rspec tests there. There are 2 straightforward options for getting the color codes working in a console window on Windows:
Install ANSICon - this will give your Windows terminal (command windows) the ability to show the colors that rspec uses. RailsBridge.org has instructions for it. (Note: I have a Windows 7 x64 and this didn't work for me. Which led me to the next option...)
Install ConEmu ("Console emulator") This not only supports the colors, but you can have multiple consoles open (different tabs within the same window), and set up commands to run when opening a new console window. I use this (NAYY) and love it.

Resources