Why is this custom nemo action not turning up in the context menu? - cinnamon

Here are the contents of my /home/usrname/.local/share/nemo/actions
[Nemo Action]
Name=Add to portamusic
Comment=Transcodes each file Ogg Vorbis and copies it to portamusic
Exec=/home/usrname/bin/add-to-portamusic.sh %F
Selection=NotNone
Extensions=Any
EscapeSpaces=true
Terminal=true
Active=true
I wanted this option to turn up in the context menu when I right-click on a single folder or file or multiple. No such luck; the option is not in the context menu ever so far as I can see.
Where am I going wrong?

All seems to be good.
May be check sh file permissions (to be execute).
Otherwise, the error is in the sh file.

Related

Show more path in vscode tabs [duplicate]

I've got a component-based folder structure in my project. It is a bunch of component-folders with one index.js file each.
Is it possible to make Visual Studio Code display the parent folder name in the file tabs? Or am I limited to seeing a bunch of tabs that all display index.js and nothing else?
You can configure Visual Studio Code to always show parent folder names in the tabs! In your User Settings, just add this line: "workbench.editor.labelFormat": "short" (other values are "long", "medium" or "default")
Result: the files init/views.js, init/routes.js and plugins/modal.js will be presented as such:
Another option is the User Setting "breadcrumbs.enabled": true which will give you an entire row of breadcrumbs showing the complete file path:
PS: To open User Settings use the File-menu → Preferences → Settings → User Settings. To view the settings in a JSON format just click the {} icon in the top right corner.
Go to the main menu File → Preferences → Settings. And search for (Cmd + F on Mac; Ctrl + F on Windows and Linux) workbench label format.
Choose the short option.
Visual Studio Code has now improved their tab-UI to resolve this issue.
When you've opened multiple tabs with the same filename, Visual Studio Code will automatically display the parent foldername in each of those tabs.
Here's an example: I've opened event.js and two index.js files. Visual Studio Code automatically decides it's a good idea to display the foldername for the index.js files :)
It pretty much solved the bulk of my problem.
I know this is too late to answer, but in case someone is looking for the file path to show on the title bar, you can follow this:
Open settings (command + ,)
Search for title
You'll see something like activeEditorShort, replace it with activeEditorLong
Save
Source:
https://medium.com/riow/vscode-show-full-path-in-title-bar-b0cb731b330
Step 1: Go to File > Preferences > Settings
Step 2: search for "workbench.editor.labelFormat"
Step 3: select medium from a drop-down
You can install the nice-index extension for a better experience dealing with index files.
However, as of now, it only works when you have more than one index file open. This can be resolved by changing labelFormat to "short", as other answers suggest.
In VSCode 1.53 you can use thees settings:
Controls the window title based on the active editor. Variables are substituted based on the context:
${activeEditorShort}: the file name (e.g. myFile.txt).
${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
${activeEditorLong}: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
${activeFolderShort}: the name of the folder the file is contained in (e.g. myFileFolder).
${activeFolderMedium}: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
${activeFolderLong}: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
${folderName}: name of the workspace folder the file is contained in (e.g. myFolder).
${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
${rootName}: name of the opened workspace or folder (e.g. myFolder or myWorkspace).
${rootPath}: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).
${appName}: e.g. VS Code.
${remoteName}: e.g. SSH
${dirty}: a dirty indicator if the active editor is dirty.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.

Any way to have workspace/folder settings ONLY apply to files in that workspace/folder and not random files outside the workspace?

I know about workspace settings. My issue is that workspace settings also apply to any files that are opened not in that workspace. Example:
"editor.formatOnSave": true // put this in some workspace settings.
open a file not in that workspace (maybe in a different project) in the same window. This happens when I type $ code ~/someFile.txt
When I save that file, it gets formatted when it shouldn't.
Any workarounds?
Specifically for saving a file without formatting, try new command for saving without formatting. Just added in v1.28.0:
The new command Save without Formatting
(workbench.action.files.saveWithoutFormatting) can be used to save a
file without triggering any of the save participants (for example,
formatters, remove trailing whitespace, final newline). The default
keybinding is Ctrl+K S. This is useful when editing files outside your
normal projects, which may have different formatting conventions.

How to change Excel 2013 Template Miniature

Is there a simple way to change / replace the automatically generated Template Miniature with a different image.
I have checked this out for Excel 2016 but the process is similar.
First, the thumbnail is generated and part of the file. There is no official process. A description for brave Office pros is shown below.
You can do this:
First, close Excel!
Get to the location of your template
Make a copy
Rename the file extension to .zip
Unzip the file into a new folder using the Windows Zip utility
Search the tree of files for a file called thumbnail.wmf
Open PowerPoint and create an empty presentation
Use the function "Insert an Image" and add the thumbnail.wmf to the slide
Remove everything else from the slide
Try to ungroup - it fails with a message asking to convert to a drawing object
From here you have two options. Either convert, ungroup, change and proceed or throw away and create a new image from scratch.
Work on image and group your image (the old or a new one), then
Right click on the grouped image and click "Save as picture"
Choose the filetype "wmf" and name it the same as before and overwrite the existing thumbnail.wmf
Go INTO the folder using Windows Explorer of unpacked files, hit Ctrl-A (Select All)
Right click and say "Send to" --> "Compressed (zipped) folder". Give it a new name.
Hit F2 to rename the file
Remove the file extension .zip
Now, open Excel!
Hit "New", "Personal" and you see your template with your custom image in full width and height. Repeat steps 10 to 16 until you're satisfied.
Drawbacks: Once you edit your file in excel and save as template with thumbnails option (advanced properties) switched on, Excel will overwrite your custom wmf-file. You have to repeat the steps "Unpack -> Replace File -> Pack" every time.
I'll post an update once I found a better solution.
Here is an automation of the process that might help with understanding the process described in the answer.
Python 3 code snippet
import zipfile
import shutil
exfilename = 'MYTEMPLATE.xltm'
a_path='C:\\TEMP'
th_path='mythumbnail.wmf'
with zipfile.ZipFile (exfilename, 'r') as zf:
#Extract to temporary folder
zf.extractall(a_path)
#replace the thumbnail
shutil.copyfile(th_path,a_path+'\\docProps\\thumbnail.wmf')
#remake the zip as a new file
shutil.make_archive('TEMP_ARCHIVE','zip',a_path)
#rename back to original, replacing original
shutil.move('TEMP_ARCHIVE.zip',exfilename)
#clean-up temporary files
shutil.rmtree(a_path)

How to remove the lock in file association in eclipse

IN Eclipse i want to chnage the default editor of some .htm files.
If i try to go to FIle Association and assiciate the default editor then file gets opened in that new editor but i don't get the syntax highlighting.
The solution is that the file association is locked ny some plugin editor
Preferences -- Context type----text ----Your editor -- reomve the extension
But i get the .htm(locked) so i cant remove it.
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-content-type.htm
Note: Certain items will be marked as "locked". An item is locked if
it is one of the associations provided by the plug-in that declares
the content type. In other words, you can remove only user-contributed
associations.
Is there any way to remove those locks even thought it can be hackish way but i want to do it
You don't need to "unlock" an existing association to add a new association and make it the default.
Add a new association via the "Add" button
Select the new entry
Hit the "Default" button to make your new entry the default editor
Could it be, that you want to change the "File Association"? This can be done in General / Editors / File Associations. BUT Eclipse uses at least one default-editor and this is the reason for the "locked"-message in the "Content Types". You could set the "Text Editor" to all unwanted types. Looks like a workaround, but makes sense, because it is the same as the file associations of your operating system, that asks you for the program to display the file.
Another question is, why do you want to unlock or remove the "Content Type"? Does it change anything in the Eclipse logic?
Go see this answer from "Greg Desmarais" (assign the desired editor to "default")
https://stackoverflow.com/a/15642583/162094

Beyond Compare 3 editing disabled

With BC2, when i click the Show differences... option in SourceGear Vault. It allow me to copy from the repository to the working version and save but I can't do this with BC3. It doesn't allow copying to the otherside (right) and have the editing disabled showing at the bottom of the BC3. It is even the same with DiffMerge. What am I not understanding here?
Can someone explain to me why the changes in BC3 and is there a workaround?
Beyond Compare will disable editing of a file for any of the following reasons:
It's one of the input files in a 3-way merge
The comparison was cancelled
The comparison encountered an error (corrupt file, invalid character encoding, out of memory, gamma rays, etc)
The file format's conversion settings don't support converting back to the original format (MS Word, PDF)
The file is on a read-only "filesystem" (7zip/RAR/CHM archives, CD/DVD-ROMs)
A file or parent folder had editing explicitly disabled by the user in the session settings or using the /ro command line switches
The viewer itself doesn't support editing (eg, Hex Compare prior to v4)
Also, the Full Edit (F2) toggle in the Text Compare View menu switches between inline editing and line-based mode. If it's disabled you can copy/delete whole lines and type in the line details edits at the bottom of the window, but the main windows won't have a cursor, typing is disabled, and it will always select whole lines. Unlike the above items, this doesn't show "Editing Disabled" in the status bar.
there must be a flag on the command line to call BC such as /ro# or /#ro or /(side)readonly (where side is left or right), it prevents editing.
these flags are there because differs are often called with temporary files to diff, in particular from SCC. and Vault probably has a single "external diff" command, thus you have to choose whether the flags are always there, it protects you from unexpectly editing a temporary file and loose this work when closing the diff tool, or not.
The few reasons I have found are:
If the encoding of the file is different than the default. In this case change the encoding to the expected one. (Japanese-ShiftJIS in my case)
If a refresh of files is in progress.