How do I test my GtkPrintBackend? - printing

I am trying to develop my own GtkPrintBackend ,
taking help from here:
https://mail.gnome.org/archives/desktop-devel-list/2006-December/msg00069.html
I want to test my print backend( by making the print dialog use my backend instead). How do I do that?
That is, how do I make the Print dialog use my backend instead?

Answering my own question here since I figured out a workaround:
I installed jhbuild and built the gtk+ module using jhbuild.
The source code of the corresponding module is downloaded in ~/jhbuild/checkout/<module-name> .
Modify the print backends under ~jhbuild/checkout/gtk+/gtk/modules/printbackends/ directory, and rebuild it (Find instructions to do that here).
Now when you launch a gtk application from the jhbuild shell, it will use the modified backend instead of the system default one.

Related

Permission error for shutils moving png to path

You see I am making a python gui with pysimplegui for my old qrcode generator script so im using shutils for the user to download the file.
I am using the 'default' thing because i want it to save to my users path not mine, do you know some other way I can do that? because i think this is the reason its not working
I tried making it so the user inputs there username such as 'My laptop' so it adds it to the path
src_path = r"D:\Python\QRcode generator\output.png"
dst_path = r"C:\Users\Default\Pictures"
shutil.move(src_path, dst_path)
The code is correct. It wont give any error if you dont use C drive (Where the operating system is installed)
This is mostly due to C drive is protected for windows stability.
If you are using any code editor (Pycharm, VS Code etc.) or running the code in windows command prompt or any terminal etc. Try and run it with administrator rights
It should work.

How to respond automaticly with properties file to a yeoman prompt

When i run a app generator many question is ask by the prompt.
How can i run the "yo" command with, for example, a file with the answers for generate the app automatically without user interaction ?
Thanks
Yeoman supports options and arguments http://yeoman.io/authoring/user-interactions.html
You can skip prompts when an option is provided instead. But this needs to be done manually by the generator author at the moment.
You can check the source code of generator-node and see how it is done over there: https://github.com/yeoman/generator-node/blob/master/generators/app/index.js
A custom adapter can be used to provide answers to questions. This does require creating a new executable though, as the yo command does not support custom adapters.
Find an example of an adapter that answers questions at https://github.com/OctopusSamples/content-team-apps/blob/main/js/octopus-template-generator/src/domain/yeoman/adapter.ts.

Awesome desktop manager widgets

I came upon this problem before, but only now it really renders awesome desktop manager useless.
I was searching how to connect to Wifi with awesome. Found Gigamo Wifi Widget. Cool, how do I eat it?
The awesome wiki entry on widgets does not really answer this question.
I know my question is very stupid and the answer is somewhere in the documentation but I have no idea how to read it. How and where do I add widgets I find on the Net to my awesome lua files?
EDIT:
when searching where is the rc.lua file henfiber mentioned, I came upon Archlinux wiki on Awesome, which put most important things in one page.
You can always use NetworkManager which is available for installation in most official repos. It contains an applet which creates an icon at your system tray. You can launch the applet at start-up, placing this line in your rc.lua file:
awful.util.spawn("nm-applet")
or you can start it manually from your terminal, writing:
$ nm-applet &
Then you can left-click at the NetworkManager Applet icon at the system tray and select from the list of available wifi access points. Additionally, the Network manager applet allows you to perform more advanced functions, like connecting to VPN.
Also, it is quite easy to use 3rd-party widgets you find in the wiki or in github. It requires these steps:
Download the widget .lua file - let's say it is called
cool_widget.lua
move it in ~/.config/awesome/ so it is :
~/.config/awesome/cool_widget.lua
An alternative is to use the structure
~/.config/awesome/cool_widget/init.lua
it is better when your widget requires more than one files.
Load the widget at the top of your rc.lua file:
cool_widget = require("cool_widget")
Add the widget in a wibox (toolbar) in the same way you add built-in
ones

I want to use EtherPad (or a clone). My site is running Ruby on Rails. API or local install?

I'd like to utilize an etherpad interface on my website. Two questions:
1) is there any site with an etherpad api that I could just call remotely?
2) if not, how much trouble is it to install scala and have the two run concurrently?
Thanks
Check out http://piratepad.net and http://ietherpad.com
And you can embed those etherpad instances using a simple iframe as suggested here: http://etherpad.com/ep/blog/posts/embedding-etherpad
There doesn't seem to be a proper API yet for more robust interactions.
The original etherpad.com has now gone away but at that link there is a list of clones.
The instructions for embedding etherpads seems to have gone away with the rest of etherpad.com but I believe it's as simple as this:
<div id="ep">
<iframe src="http://etherpad.com/foo?fullScreen=1"></iframe>
</div>
Replace "etherpad.com" with whatever clone you're using, "foo" with the name of your pad, and you may or may not want to change that fullScreen=1 to fullScreen=0 (or leave it off altogether).
Installing scala might mean a few things:
Installing the SDK (i.e. scalac)
Installing the runtime
Assuming you mean the runtime, scala runs entirely on the Java Virtual Machine (JVM) so assuming you have 1.5+ JVM installed, you can run scala programs on it easily (Scala just compiles down to bytecode, after all). All a scala program requires is a few JARs on the classpath (scala-library and scala-compiler)
Now there is a better solution Etherpad Lite it is easily installable and embedable. See http://etherpad.org

How Can I get muitiple files selected to the same application launch from a "right click" context menu (windows explorer)

I am able to get a shell registry type context menu function to work , see below . But is there a way to tell windows to send multiple files selected to the same application , perhaps instead of %1 or %L some other parameter . What happens now is that it launches the associated application for each file in the list .
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*\shell]
[HKEY_CLASSES_ROOT*\shell\sendtomyapp]
#="&Upload to (File*Pics)Mojo"
[HKEY_CLASSES_ROOT*\shell\sendtomyapp\command]
#="c:\Program Files\app_directory\App.exe -n \"%1\""
Is there a way to send an array of names like sys.args in python ?
My guess is to look into DDEExec instead of shell\open\command. http://msdn.microsoft.com/en-us/library/bb165967(VS.80).aspx
Seems like a superuser.com question, but I think these kind of operations require a bit of code. e.g. you write a proxy program that accepts the files, and adds them to an execution queue or batch of another program (like adding several files to a media player) I don't know if what you are looking for is supported inherently in Windows
You will need a full shell extension DLL to do what you want to do here. So the answer is programming even if the question was not.

Resources