I have the below line to run a binary file in linux,
binaryFile $2 & > logfiles.txt
Whenever it is executed it creates a small icon on the left top corner of the screen (attached image),
I want to run the binary without the icon(the small line).
Is there anyway to do that?Please help.
EDIT:
I got to know XtRealizeWidget is creating that small icon,
In the code,
a topLevel window is created using XtAppInitialize and XtRealizeWidget(topLevel)is called which creates it.
Is there a way to disable the icon via code.
Related
I use Imagemagick's "import" (import-im6.q16) a lot for capturing screen data. And it works great on my primary workstation using the Mate desktop.
But I am trying to use it on Jammy/Gnome and it just hangs.
Nothing in any of the obvious logs (syslog,Xorg). Searched the web and the Imagemagick communities and come up empty.
Executing import tmp.png should turn the "cross-hair" cursor on and allow selection of a region of the default X display. Upon "mouse up", the selected region is written to the file specified. An existing file will be overwritten permissions permitting. The suffix should be an image file type or errors can occur (.pdf is an example).
Can anyone confirm this is broken or working with Gnome?
I am making a simple app that reads from a file and renders an image from that file. The file format is 0 for a blank character and 1 for a full character. Then, my app reads from that file and outputs to the terminal the interpretation of that file.
The only problem with that is that the width and height of my images are limited. I would like to draw each pixel using a window. How can I do that in NASM x64, on Linux, without using other languages like C/C++?
I have looked everywhere and I only found something using the C Windows API in 32-bit, which doesn't answer my question or help me. Help would be appreciated.
I need to store a window size and position for multiple windows in tauri. And restore it after open. For example there was opened 3 windows and they have located in different parts of desktop. And when i'll open an application again app will restore all three windows(windows are the same) and restore their positions and size. Is it possible?
Tauri has a plugin for exactly this: https://github.com/tauri-apps/tauri-plugin-window-state (recommended solution).
You don't necessarily have to use this but its code should serve as good inspiration.
A JS-only solution is a bit tricky because there is no exit-requested event for the event loop on the JS side, only close-requested for the windows.
This wouldn't be an issue if you have a specific point in time where you want to save the windows. In that case you could just save a json file to disk containing the size/position and the window labels which you then read on app start to re-size/re-position the window.
The problem:
I'm currently working on a programming language, which uses a simple python interpreter. The interpreter loops over every line with a bunch of if-statements.
The file extension I'd like to use is .ccp.
So far my progress. I want the computer to recognise .ccp files as a CalcScript file, and open it with the script.
I don't want to have a default filename which I can open using text = open("filename.idk","r").read(), I want to open a file like a 'normal' file. You double-click on the file in explorer, and it opens it in the python script. Regardless of the filename.
What I've tried:
Tinkering with the default applications in settings
Tinkering in regedit
Converting my .py file to .exe
Scouering the internet
My code:
https://github.com/AnonymousPixel/CalcScript
Sorry for bad English if there was any.
Summarizing my comments on the question, you can follow the steps below to achieve what you are asking:
Use sys.argv to access the command line arguments. For example the following script will just print all the arguments given to it:
import sys
print("Given arguments: ", str(sys.argv))
Let's name it myprogram.py.
You can then call it (I think) with: python myprogram.py arg1 arg2 arg3 and it will run and print the command line arguments.
Notice that the first argument (sys.argv[0]) is the script's path. So arg1 would be sys.argv[1], arg2 would be sys.argv[2] and so on.
I am saying to use sys.argv because as far as I remember double clicking a file with an extension which has a default opening program, will open that program with the file path as an argument.
Next step is to package your python script to an executable. This has been already asked and answered for example here (which is a duplicate, where you can follow the question which came before it to see even more examples). I used PyInstaller to test it (and on Windows OS). My command was like:
pyinstaller myprogram.py
... and it generated some folders and files. Specifically the folder dist\myprogram contained the executable along with its dependencies. You can then run your program by double clicking on it in the dist\myprogram folder. It should pop a CLI window, printing the arguments (ie only the program's path, since we called it without any other) and immediately exit. Or you can open a CLI window and run it with a command like:
myprogram argument1 argument2 argumentN
(supposing your current working directory is dist\myprogram) and it will indeed print the arguments.
Finally you have to set it up as the program which by default opens files with .ccp extension. On Windows 10, you can do this via:
Open up File Explorer.
Find a file with .ccp extension (or create one).
Right click on it.
Click on Properties on the dialog that pops up.
Go to General tab (if you are not already there) on the dialog that pops up.
On the Open with: section there is a button which reads Change. Click it.
Select More apps at the bottom of the dialog.
Make sure you have the Always use this app to open .ccp files checkbox selected.
Scroll to the bottom of the dialog and click on the blue text which prompts for manually selecting the default app, which in turn pops up a file chooser. I am not running on English language so it is a bit difficult to translate it exactly (I followed some online pages to actually see the default translation for the previous steps).
Select your executable as the default.
Confirm your choices by selecting Ok, Apply or anything else required.
Then you will also be able I think to change this extention later via:
Settings --> Apps --> Default Apps --> Choose default apps by file type.
Some references:
PyInstaller website and introductory manual.
Official page for step 3.
Unofficial page for step 3, a lot more detailed.
I have many many .png files and I'm looking for a way to generate height maps (or normal maps) for each of them. I can get the result I want from the gimp normalmap plugin but I need a way to automate the process or an alternative tool. I don't know enough about the underlying algorithms to reproduce them, and very little about cg in general. Is there a library or tool that will do this? I'm not picky about the language as long as the api/interface is high-level enough, though open source is preferable as I don't have access to fancy software at the moment. Thanks!
You can jsut script GIMP itself for that.
I don't know which plug-in you are calling 'normalmap' - or what you mean by 'height map' (height maps I know are just the grayscale version of the image) - but even if it is a third party plug-in, it should be possible to run it through the scripting interface.
Just go to plug-ins-> Python-FU->console - you will be dropped to a Python prompt. Click on the "browse" button - then locate the plug-on you want to call. If you click "apply" - the browser will paste a template for the plug-in call to the Python prompt.
SO, prior to doing that, you may want to test the call: open a sample image, go to the Python prompt, and get a reference to the image by typing:
image = gimp.image_list()[0], then get a reference to the first layer of the image typing drawable = image.layers[0] .
These should be all the data the call for your plug-in would need to be pre-created. Do as above to paste a call to your desired plug-in on the prompt. Note that the names image and drawable above are just variable names - you may chooseyour own - but these are the names that are usually pre-filled in when you pick "apply" from the "Browse" button for a procedure call.
Once you get it working up to here, you can leverage on Python to open all images in a folder, apply the plug-in, and save them back - you can typ e this directly on the console, or later, create a plug-in that will show up in the menus.
import os
for filename in os.listdir('mydir'):
if not filename.endswith('.png'): continue
name = 'mydir/' + filename
image = pdb.gimp_file_load(name, name)
pdb.plug_in_bump_map(......) # use your plug-in here
outputname = 'mydir/' + name.split('.')[0] + '_normal.png'
pdb.gimp_file_save(image, image.layers[0], outputname, outputname)
pdb.gimp_image_delete(image) # just frees the image from memory.
Just press twice and the sequence will be run for an entire folder.
(Note that if you want to run the "bump-map" plug-in there are several parameters that have to be replaced from variable names to the actual values you want).
If that is what you want, and you will be using it a lot, save it as a .py file, and put that code inside a proper function to turn it into a plug-in
- there is a fill examplee for that in my answer here:
GIMP: Create image stack from all image files in folder