KDE Custom shortcut to re-implementing copy paste (could DBus work ?) - dbus

I'm on KDE in french and I use the Raccourcis Personalisés menu to create custom keyboard shortcuts, I would like ⊞ Windows+C and ⊞ Windows+V to be copy (bash xclip -selection clipboard) and paste (xclip -selection clipboard) but writing those commands in the menu do not work.

Related

conemu - on startup open two windows and position them like i want

I don't know if that's possible.
I managed to have conemu open two tabs (with a custom name) on startup and cd inside the folders i needs, now my question is:
Is there any way to make conemu open two different tabs in two different windows and position them top-right-corner and bottom-right-corner?
The task i run on startup is the following:
title Website & cmd /k "%ConEmuDir%..\init.bat" && cd c:\src\www
title Other& cmd /k "%ConEmuDir%..\init.bat" && cd c:\src\other
Thanks
As always, read the documentation.
Use -new_console to open a separate window, play with tabs normally. Documentation.
If you’re lucky, the author of ConEmu will notice you and help you out better than I can.

Conemu startup with a task opening multiple tabs

Is there a way with conEmu to by default open a number of different tabs?
I saw this page explaining how to do this with splits,
and I realize I can do Ctrl + T, 1, Enter, but I was hoping there was a way to do this automatically!
"%GIT_HOME%\usr\bin\sh.exe" --login -i -cur_console:t:"repo1":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo1"
"%GIT_HOME%\usr\bin\sh.exe" --login -i -new_console:t:"repo2":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo2"
"%GIT_HOME%\usr\bin\sh.exe" --login -i -new_console:t:"repo3":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo3"
Yes, it is possible but not via the settings Dialog of Conemu. You need a small config file
Create Config File
Go to Conemu installation directory (like C:\Program Files\ConEmu)
Create file startup.txt
List the consoles you want to open at startup. For example
>C:\Program Files\staab\Git\bin\bash.exe
>C:\WINDOWS\system32\cmd.exe
will open Git Bash and cmd at startup (in that order). If you want to set the startup directories for each console you can do this too:
>C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path
>C:\WINDOWS\system32\cmd.exe -new_console:d:C:\other\path
Start Conemu with that config file
Create a new desktop shortcut for the ConEmu64.exe (or ConEmu.exe if you use the 32-Bit version)
Right click > Properties on that shortcut.
Add /cmd #startup.txt to the target
Now you can link that shortcut to your task bar or put it in the autostart folder of your computer to start Conemu with those consoles right after login.
Update 1: Name for Tab
I just found out that you can also set the name of all the tabs on startup :-)
>C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path -cur_console:t:NAME_OF_TAB
Update 2: Admin Rights
And this is how you give admin rights to the tabs of your choice:
>C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path -new_console:a
Don't use this more than necessary, because you have to confirm admin rights for each window individually.

How to pin to start menu using a batch file (Windows 10)

I need to pin an executable into the new Windows 10 start menu (i.e. creating a tile).
I'm aware of PowerShell scripts that do the job, but I need some instructions to add at the end of an existing batch file (cmd) we already use for installing our applications.
The usual scripts (valid for Windows 8 and 8.1) simply don't work. How can I do this?
This is a kludge work around that Microsoft needs to fix, but it worked for me.
Temporary rename the .bat file to .exe. Then right click on the file name. It will give you the Pin to start option. Pin it to the start menu. It won't work, but there is an option open the file location. Select that and change the name back to .bat. Now it works.
The way it works on Windows 10 after trying almost 15 different methods that didn't work for me
Go to your desktop -> right-click -> Create New Shortcut
In the shortcut target type the following text:
cmd /c "full path to your batch file"
It will look something like this:
cmd /c "C:\Users\Jmeter\Desktop\jmeter.bat"
Name the shortcut.
Right-click on the shortcut -> select Pin to taskbar. If you'd prefer it pinned to your Start menu, select Pin to start instead.
Bonus: Download some .png image -> Go here (https://icoconvert.com/) -> convert to Windows icon file -> set as new icon
Note: I've wrote and tested this on windows 8 - you might face issues on windows 10.
Check this. This a JScript/bat hybrid that uses the shellapplication object and invokeverb function (i.e. emulates right click and chooses some specific actions). It is now compatible with Windows 10.
Use it like this (you can use also a shortcut/.lnk to an exe):
call pinnerJS.bat "%windir%\system32\cmd.exe" startmenu
Follow my original method, and you will get .bat file{s} pinned in Taskbar. WORKS 100%
Step 1: Create shortcut of your .bat file (for example in Desktop “C:\Users\youruser\Desktop\yourfile.bat”). So you will end up with “yourfile.bat – Shortcut.lnk” (you might not see extension “.lnk”).
Step 2: Right Click your shortcut and change your Target field from: “C:\Users\youruser\Desktop\yourfile.bat” to: explorer “C:\Users\youruser\Desktop\yourfile.bat” – note: explorer is the explorer.exe app. You can also write the full Path: C:\Windows\explorer.exe, for no confusion.
Step 3: Now Right Click your shortcut and now you can see the option Pin to Taskbar.
Step 4: Right Click the pinned shortcut, and you will see two options: shortcut itself and unpin option. Right Click the shortcut and select Properties. From Target field delete “C:\Windows\explorer.exe” and leave only “C:\Users\youruser\Desktop\yourfile.bat”, and click OK
Now you can delete your shortcut in Desktop, since now you have your standalone shortcut on Taskbar
Optionaly, if you want to change Icon do Step 4, but now click “Change Icon…” button, and choose your custom Icon, from some other exe file or .ico file.
That’s it!
Now you have fully functional batch file shortcut on Taskbar
Right now, you can't do this with free tools (maybe Windows want to get into the "pay2tile" business model).
One possible option at the moment would be to use Classic Shell.

save entire cmd screen to image

I just finished writing a program, (download here if you're interested) Basically, it is like an etch-a-sketch. here's a screenshot of version 1:
Version 2 is more like a pixelated painting program. Here's a screenshot: As you can see, v2 supports 16 different colors.
Anyway, I want the users to be able to "save" their creations. I know that I can highlight everything, and copy it into a text file, but this does not get the colors, and there isn't a clean way to do this (that I know of).
Is there a command line tool that I can download to save screen output as an image? Or am I screwed?
By the way, This is just a batch file, compiled with This program. It only works compiled, because the compiler features advanced commands, the kind that allow me to have multiple colors in one window. You can check out the source code here. All lines starting with REM are the "advanced commands".
:edit
I was originally just going to go with a method that saves all of the text, but when I add colors, it looks something like this. Here is what it should look like:
You can use this commandline tool (I made it in AutoIt):
Capture.exe
Use :
capture.exe outputFile.jpg (png,bmp)
It will capture the entire screen.
EDIT :
You can use THIS new one :
Use :
Capture.exe "Title_of_the_Windows"
So in your bat, give a title to your CMD windows, using :
Title capture
and then display your colored text, and just make a :
Capture.exe "Capture"
This will create Output.jpg.
you can do this without external tools ,but you'll need .net framework (installed on windows from vista and above by default) and screenCapture.bat
call screenCapture screen.png png n

In gvim, how do I create a shortcut to open a file using the gui file open dialog

In gvim, when I open a file via the file menu I get my operating system's native GUI file open dialog. In most other editors you can access this via a keyboard shortcut instead of going to the file menu. But in gvim the shortcut (as it appears in the file menu) is :edit which is a "command line oriented" way of opening files, not a GUI for opening files.
Is there a command :blah that will start the file open dialog for me? I know other, similiar such commands exist (for example :set guifont=* will open the GUI font selector.)
:browse confirm e
should be what you're looking for.
For Gvim on Windows, just hit "Alt + F + O" key combo (equivalent to typing ":browse confirm e").

Resources