Changing keyboard layout from terminal on opensuse - terminal

I am trying to bind shortcuts for keyboard layouts.
For example:
Shift+Alt+1 - change to US layout
Shift+Alt+2 - change to UA layout
Shift+Alt+3 - change to RU layout
instead of change it with Super+Space.
In Ubuntu I used to bind such shortcut to gsettings set org.gnome.desktop.input-sources current 1, but in opensuse it doesn't work.
It is possible to do somehow?

I have solved it with little trick.
I created script with such content (for each keyboard layout):
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'ru')]" &&
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ru'), ('xkb', 'ua')]"
And bind custom shortcut that run this script.
This script changes list of layouts, left there only one layout, because of it system change layout, and then I change list of layout to initial state.

Related

Current line text font size gets increased while typing in Xcode

While I am typing on a specific line in workspace, the text present in the particular line's font is getting increased ! And it gets to regular size as soon as I stop typing.
I also upgraded to XCode 8.2 still the same issue occurs.
FYI:
I have also tried the following code to reset the XCode default settings, but still no use.
defaults delete com.apple.dt.Xcode
Solution:
This happens when you change font size for one particular element but the other editor's elements are using the previous/default font size.
If you want to change the font size either press cmd + or in preferences -> Fonts and Colors choose your theme and in the right pane select all the elements (press cmd a) and then change the font size.
See this SO answer
I had a similar problem but I am not sure is exactly the same.
Did you try to change this settings?
Xcode preferences > Fonts & Colors Your chosen theme will have a
"current line" option just under the font. Can't remember exactly but
I think you can find something there.

How to change the defaults alignment to left in pygtk?

Every program that I'm making using pygtk is right-alignment by default (maybe because my default language is right to left language?)
How can I change it?
The orientation of the widgets in a container depends on the locale. You can change the locale settings on Windows by setting the LANG environment variable.
set LANG=en_US
something.py
On Linux you can do the same with the following commands
export LANGUAGE=en_US
something.py
or simply
LANGUAGE=en_US something.py
And if you want to adjust direction of widgets inside a widget (for example a window), regardless of system locale:
widget.set_direction(gtk.TEXT_DIR_LTR)
And to change default direction for everything inside your app:
gtk.widget_get_default_direction(gtk.TEXT_DIR_LTR)
Or gtk.TEXT_DIR_RTL instead of LTR

Sublime Text 2: How do I change the color that the row number is highlighted?

As the subject says, I want to change to something other than the very light grey as shown below (line 319). I have a hard time seeing that, especially when doing a 'find in files' command.
The easy way: Pick an alternative Color Scheme:
Preferences > Color Scheme > ...pick one
The more complicated way: Edit the current color scheme file:
Preferences > Browse Packages > Color Scheme - Default > ... edit the Color Scheme file you are using:
Looking at the structure of the XML, drill down into dict > settings > settings > dict >
Look for the key (or add it if it's missing): lineHighlight. Add a string with an #RRGGBB or #RRGGBBAA format.
On windows 7, find
C:\Users\Simion\AppData\Roaming\Sublime Text 2\Packages\Color Scheme - Default
Find your color scheme file, open it, and find lineHighlight.
Ex:
<key>lineHighlight</key>
<string>#ccc</string>
replace #ccc with your preferred background color.
tmtheme-editor.herokuapp.com seems pretty nice.
On the mac, the default theme files are in ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Color\ Scheme\ -\ Default
On Win7, the default theme files are in %appdata%\Sublime Text 2\Packages\Color Scheme - Default
For Sublime Text 3, all I had to do was add "highlight_line": true to my user settings file: Preferences -> Settings - User. It was only once that preference was set that all the color scheme lineHighlight settings took effect.
Hopefully this will save someone else some of this same flailing about.
This post is for Sublime 3.
I just installed Sublime 3, the 64 bit version, on Ubuntu 14.04.
I can't tell the difference between this version and Sublime 2 as far as user interface.
The reason I didn't go with Sublime 2 is that it gives an annoying "GLib critical" error messages.
Anyways - previous posts mentioned the file
/sublime_text_3/Packages/Color\ Scheme\ -\ Default.sublime-package
I wanted to give two tips here with respect to this file in Sublime 3:
You can edit it with pico and use ^W to search the theme name. The first search
result will bring you to an XML style entry where you can change the values. Make a copy
before you experiment.
If you choose the theme in the sublime menu (under Preferences/Color Scheme) before you change this file, then the changes will be cached and your change will not take effect. So delete the cached version and restart sublime for the changes to take effect. The cached version is at
~/.config/sublime-text-3/Cache/Color Scheme - Default/
If you have SublimeLinter installed, your theme (at least it ST3) may end up in .../Packages/User/SublimeLinter/[ your-chosen-theme ]
As mentioned above - find the nested 'settings' dict and edit or add the 'lineHighlight' entry with your desired #RRGGBB or #RRGGBBAA. I like #0000AA99 when on a black(ish) background.
Handy tool if you do not know your color combinations: RGBtoHEX and HEXtoRGB

Adding new filetypes to Windows 7's New context menu

I'm trying to add CSS, PHP, JS and HTML file types to the "New" right click menu in Windows 7. I know how to add the file types to the menu with ShellNew entries in the registry. But Windows doesn't give you any control over the display names of the new items - according to this the name's always taken from whatever application you've assigned to open the doc. I've set Notepad++ to open all of these file types, so I'm going to end up with several identical "Notepad++ document" entries in the menu, like this:
Does anybody know if there's a way out of this stupid situation without installing any tweak utilities?
Thanks all!
Fred
To rename a context menu > new's item (in Windows 7, at least):
Open regedit.
Go to HKEY_CLASSES_ROOT\.%ext% and note the (Default) value. This is the file extension's ProdID.
Go to HKEY_CLASSES_ROOT\%ProdID% (usually %ext%file) using the value obtained from step two. Set the (Default) value to whatever you would like the context menu new item to display as.
Under HKEY_CLASSES_ROOT\%ProdID%, if there is a FriendlyTypeName value, rename it to FriendlyTypeName.old, as the (Default) value "is deprecated by the FriendlyTypeName entry"
I don't believe there is even a need to log out / restart, but if the changes don't take effect, log out and/or restart.
You could change the file type description for each file class manually.
Look up the prog id under HKEY_CLASSES_ROOT\.%ext% (The default value)
Under HKEY_CLASSES_ROOT\%progid%, set the default value and/or the "FriendlyTypeName" string to the string you want.
You might have to log off for it to take effect.
You should probably stay away from the Chrome and Notepad++ file type/association dialogs so they don't overwrite your strings.
Both Chrome and Notepad++ are open source, you can create a patch for them that use better names for the file types. (What is a "Chrome HTML Document" anyway, HTML5 + extra chrome juice? =) )
I was able to derive a solution from the answers above.
I replicated the particular application (JetBrains PHPStorm in my case) registry entry.
PHPStorm2019.1 -> PHPStorm2019.1.scss, PHPStorm2019.1.js.
Now I changed the Default REG_SZ of PHPStorm2019.1.scss to SCSS File and PHPStorm2019.1.js to JavaScript file.
Mapped .scss and .js to PHPStorm2019.1.scss and PHPStorm2019.1.js respectively.

Mathematica quickie: About making cells Input cells by default

I'm going through some lecture notes, Fundamentals of Mathematica Programming (see the .nb file there). I'd like to be able to do the exercises right there in the notebook; but for some reason I can't figure out how to make the default cell an Input cell. In other words, when I'm clicking in that notebook to create a new cell--in the exercises--the cell is by default a text cell. I'd like for it to be an Input cell so that I don't have to manually change it each time. Ideas?
The default cell style of a vanilla Mathematica install should already be "Input". It sounds like you perhaps are using an edited default stylesheet or have changed the preferences.
For recent versions (6.0+), go to Preferences, and under the Evaluation tab, make sure "Style of newly typed cells" is set to "Input", and that the drop-down below it labeled "Format type of new input cells" is set to "StandardForm".
For older versions, make sure Cell → Default Input FormatType in the menu is set to StandardForm. To check/change the default cell input type, open Format → Option Inspector... in the menu and navigate to Cell Options → New Cell Defaults and set DefaultNewCellStyle to "Input".
You can set the scope of the Option Inspector to global or notebook in the dropdown at the top. The particular notebook you linked to has the default style set to "Text" which is the problem.

Resources