GNU Screen: programmer-quotes ` ` in Readbuf? - gnu-screen

The commands need absolute paths in slurping. So I need programmer-quotes, because of laziness to write long paths. How can I use them like:
^a :readbuf `pwd`/file

Your question seems to assume that it is possible to use backticks in this way. However, screen does not appear to support backticks in the :readbuf command. It also does not support other shell conventions such as ~ for home directory, or $XYZ for environment variable expansions.
When screen reads the file named in the :readbuf command, the file name is relative to the current directory where screen started, not the current directory of whatever is displayed in the active window. This might be why you found that absolute paths worked for you. Try using a filename relative to whatever directory you started screen from originally.
Update: For additional work on this answer, see: GNU Screen: Environment variables

Related

The location of .config for geotiler on Windows

I'm working in jupyter notebook on Windows with matplotlib basemaps and I want to use geotiler with the basemaps. I'm writing a program and as part of it, it will generate a map and plot data points on it. However, the maps that my code generates often are over a small part of the world and have no defining features. My solution was to import the geotiler library and display it over the map with an alpha so the maps generated would be identifiable. However, when I use the geotiler.Map() function, I get a message saying that the configuration file does not exist.
The code and the error message
How do I locate the .config folder on Windows, if it exists, and where should I create it if it doesn't? I already tried my user folder but that didn't seem to work. Thanks in advance.
Figured it out.
The read_config() method in the source code tries to get the HOME environment variable, which for Windows is blank, and appends the path for the config to that. Importing os and manually setting the HOME variable to wherever you placed your .config folder seems to do the trick. You can do this with os.environ['HOME'] = 'C:\Users\YourName'.

How to build with a custom eglfs cursor atlas?

I'm trying to change the eglfs mouse cursor graphics for my embedded linux QT application (QT5.5). I have the new cursor atlas PNG and the new JSON descriptor file, but the documentation is rather vague:
".. a custom cursor atlas can be provided by setting the QT_QPA_EGLFS_CURSOR environment variable to the name of a JSON file. The file can also be embedded into the application via Qt's resource system."
I'd prefer to keep everything within the resource system if possible but I can't work out how to do it.. do I need a specific qrc file containing the path to the JSON file? I assume that the PNG file would also need to be added as a resource so that it gets built into the application?
If adding it via the resource system is a bad idea where's the correct place to set the QT_QPA_EGLFS_CURSOR environment variable? I'm currently specifying the platform on the command line via "-platform eglfs"; will this be ok or will I need to set the platform to eglfs in the build?
After much trial, error and digging around I have found the solution that I was looking for within the resource system.
Create a new resource file called "cursor.qrc", the contents of which needs to be two lines:
path/to/your/custom-cursor-atlas.png
cursor.json
The first line (path to your cursor atlas) must be relative to your resource directory.
You then need to put the JSON file (contents as described in the documentation) in the root of your resource directory. It must be called "cursor.json", and its image location line must must match the location in your new resource file and be of the format:
"image": ":/path/to/your/custom-cursor-atlas.png",
This will then include your cursor atlas in resources, and Qt will find it when your application starts.
Run time solution example:
export XDG_RUNTIME_DIR=~
export QT_QPA_EGLFS_CURSOR=~/cursor.json
In the cursor.json:
"image": "cursor.png",
Put your custom cursor.png atlas into your home dir (~) then run the Qt app from there.

Intellij idea Live templates variable run groovy script relation file path

Live templates -> edit variable.
I can specify groovy file in variable settings: groovyScript("C:/test.groovy")
Where is "home" directory to store my script? i Want something like that:
groovyScript("test.groovy")
For easy export config to another PC.
groovyScript's argument can be either the script text itself or a filename. In the latter case the filename is relative to idea or idea/bin directory. It's probably better to use absolute paths.
In recent IDEA builds you can share live templates by copying them to clipboard (Ctrl+C, see https://youtrack.jetbrains.com/issue/IDEA-141077)

Xcode:How to import parent's header in a sub-project

I've a project that has a subproject (an XPC worker). Here I need to import one header from the main(parent) project. How do I do this?
I tried by setting(Sub project's) Header Search Path, User Header Search Path with values like $(SRCROOT) & $(SRCROOT)/../Interface.h. Also tried by changing the settings Recursive and Non-Recursive.
The way to solve these issues is to look at the actual compiler line when building the target to see what folders are being specified in the -I options and work from there. You need to go to the Build Log, find a file being compiled and then expand the command using the dropdown button thing on the right of the line.
The structure for all projects is fairly unique, so it's almost impossible to provide a one-size-fits-all fix for this.

How to set wizard images in NSIS through CMake/CPack?

I see that there is no CPACK_xxx variable for changing the wizard image(s) in NSIS (like CPACK_PACKAGE_ICON).
So I copied the NSIS.template.in and modified it. I could do something like:
!define MUI_WELCOMEFINISHPAGE_BITMAP "C:\work\project\img\wizardInstall.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "C:\work\project\img\wizardUninstall.bmp"
and it will work. However, the source code goes in a repository where many developers colaborate, and it's not really good idea to keep absolute paths there.
I tried to find some way to get my source path, and somehow create the image path from that one, but to no avail.
So, if someone knows how can i set the wizard images in NSIS, or pass the source dir (and create the path from it) to my template file, please let me know.
Since you are already customizing the NSIS.template.in file, and it is a template presumably configured with the CONFIGURE_FILE() command, why not put the following in to your NSIS.template.in:
!define MUI_WELCOMEFINISHPAGE_BITMAP "#MY_CPACK_MUI_WELCOMEFINISHPAGE_BITMAP#"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "#MY_CPACK_MUI_UNWELCOMEFINISHPAGE_BITMAP#"
Then, in your CMakeLists.txt file where you set your other CPACK variables, add something like:
SET(MY_CPACK_MUI_WELCOMEFINISHPAGE_BITMAP
"${CMAKE_SOURCE_DIR)/path/to/wizardInstall.bmp")
SET(MY_CPACK_MUI_UNWELCOMEFINISHPAGE_BITMAP
"${CMAKE_SOURCE_DIR)/path/to/wizardUninstall.bmp")
You do not need to compile whole NSIS to use/change these images.
They are present on every machine which has NSIS installed in ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp
Use !define MUI_WELCOMEFINISHPAGE_BITMAP bmp_file in your .nsi script to change them.