Some settings for installing Elementary OS Freya

Source: Internet
Author: User
Tags gtk sublime text

Some settings for installing Elementary OS Freya

When you buy a sofa, you should first consider the size (whether you can put it down or lie down), followed by the quality, brand, and perception ......, The function is the first priority, and the extended function is also necessary. I will pile various sizes, thickness, cushions, and pillows on the sofa to form a nest and then lie in and read books. Because I often lie down, I made two sets of sofa covers myself (I selected materials myself, I cut myself, and I made myself) to facilitate the change of sofa covers. Today, computers may be the second only to mobile phones in the use of frequently-used information media (For Me, books are more frequently used than mobile phones). How to use them? It's just that you know, get used to, taste ...... And other factors. When the operating system is installed on bare metal, some settings will be made-install your favorite software, add shortcuts, set wallpapers, set screen saver .......

I have been using Elementary OS freya for half a year. After solving various daily problems, I found it necessary to make a simple summary (some solutions are almost forgotten ).

Use WPS in Elementary OS 0.3

1. Close the guest session of lightdm
There are more than one method. I personally prefer this solution to look cleaner, as we can see from askUbuntu.

Sudo sh-c 'printf "[SeatDefaults] nallow-guest = falsen">/usr/share/lightdm. conf. d/50-no-guest.conf'

2. plank settings
That is docker. Many people put the starter on the side of the wide screen display, and I put it on the left (whether Linux or Windows, whether Unity or Plank) I have also seen that someone uses MAC to put the dock on the left. If you do not like the default GTK theme, you can consider the three theme installed by default. I like transparent theme (although the default theme has better functionality). If you love it, there are third-party themes available.
The topic is stored in/usr/share/plank/theme. The directory name is the topic name. You can set theme settings in system settings before, and the setting page is gone after the upgrade. You can manually modify the configuration file.


# The position for the dock on the monitor. If 0, left. If 1, right. If 2, top. If 3, bottom.
Position = 0
# The name of the dock's theme to use.
Theme = Transparent

3. Hot Zone settings
This is what I think gnome should have (KDE also seems to have). I usually set two hot zones.

4. Complete the installation of the complete Language Pack
Select Chinese before the Start Menu. The downloaded Language Pack is displayed during installation, but the results are incomplete. In the "region and language" section of the system settings, you can install the language support as prompted. However, sometimes the translation is incomplete. My method is to uninstall language-pack-gnome-zh-hans and then install it.

Sudo apt-get remove language-pack-gnome-zh-hans
Sudo apt-get install language-pack-gnome-zh-hans

By the way:
If you install it from the beta2 image, you may not see the input method indicator on the tray, nor can you call the input method. Run ibus-setup and set it. The indicator may not be displayed.
Do not click "apply to login window, Guest account, and new user" in "region and language". If you click it accidentally, recover the keyboard and locale under/etc/default.

5. Install the usual software-browsers, editors, etc.
I am a heavy browser user, so I don't need the system's default browser. I use firefox or chromium to see my personal preferences and needs. I am dependent on some ff plug-ins and have the habit of opening more than 60 tabs, so use firefox and set "when Firefox is started (S)" to "display the last opened window and tab"

Sudo apt-get install firefox-locale-zh-hans
Sudo apt-get install chromium-browser chromium-browser-l10n

After the recent system upgrade, it may be strange to enter Chinese characters in the firefox Address Bar (for example, deleting the content in the address bar with the mouse selected), or even causing firefox to become stiff, the solution is to switch to the non-pinyin (pinyin) input method when entering the address bar, such as sunpinyin or English. Later, I decided to use sublime text to install sogou pinyin. For the installation method, refer:
The system does not contain office software. If you need to install wps, it is also good. For the installation method, see use WPS in elementary OS 0.3.

The Default Editor scratch supports utf8 (Chinese), but cannot input Chinese characters. If you have no research details, you need to write some code and install sublime text 3.
For more information about sublime text, see the official forum.

/*
Sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang
By whitequark@whitequark.org

How to compile:
Gcc-shared-o libsublime-imfix.so sublime_imfix.c 'pkg-config-libs-cflags gtk +-1000'-fPIC
How to use:
LD_PRELOAD =./libsublime-imfix.so sublime_text

Changes:
2014 06-09
1, Fix cursor position update for sublime text 3.
2, Combine the codes from whitequark (fix for xim immodule) and add cursor update support for XIM immodule.
*/

/* For RTLD_NEXT */
# Define _ GNU_SOURCE

# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include

# Ifdef VERBOSE
# Define DEBUG (fmt ,...) Do {
FILE * err = fopen ("/tmp/libsublime-immethod-fix.log", "");
If (err ){
Fprintf (err, fmt, _ VA_ARGS __);
Fclose (err );
}
} While (0)
# Else
# Define DEBUG (fmt ,...)
# Endif

Typedef GdkSegment GdkRegionBox;

Struct _ GdkRegion
{
Long size;
Long numRects;
GdkRegionBox * rects;
GdkRegionBox extents;
};

GtkIMContext * local_context;

// This func is interposed to support cursor position update.
Void
Gdk_region_get_clipbox (const GdkRegion * region,
GdkRectangle * rectangle)
{
G_return_if_fail (region! = NULL );
G_return_if_fail (rectangle! = NULL );

Rectangle-> x = region-> extents. x1;
Rectangle-> y = region-> extents. y1;
Rectangle-> width = region-> extents. x2-region-> extents. x1;
Rectangle-> height = region-> extents. y2-region-> extents. y1;
GdkRectangle rect;
Rect. x = rectangle-> x;
Rect. y = rectangle-> y;
Rect. width = 0;
Rect. height = rectangle-> height;
// The caret width is 2 in sublime text 2
// And is 1 in sublime text 3.
// Maybe sometimes we will make a mistake, but for most of the time, it shocould be the caret.
If (rectangle-> width = 2 | rectangle-> width = 1) & GTK_IS_IM_CONTEXT (local_context )){
Gtk_im_context_set_cursor_location (local_context, rectangle );
}
}

// This is needed, for example, if you input something in file dialog and return back the edit area
// Context will lost, so here we set it again.
Static GdkFilterReturn event_filter (GdkXEvent * xevent, GdkEvent * event, gpointer im_context)
{
XEvent * xev = (XEvent *) xevent;
If (xev-> type = KeyRelease & GTK_IS_IM_CONTEXT (im_context )){
GdkWindow * win = g_object_get_data (G_OBJECT (im_context), "window ");
If (GDK_IS_WINDOW (win ))
Gtk_im_context_set_client_window (im_context, win );
}
Return GDK_FILTER_CONTINUE;
}

Void gtk_im_context_set_client_window (GtkIMContext * context,
GdkWindow * window)
{
GtkIMContextClass * klass;
G_return_if_fail (GTK_IS_IM_CONTEXT (context ));
Klass = GTK_IM_CONTEXT_GET_CLASS (context );
If (klass-> set_client_window)
Klass-> set_client_window (context, window );

// Below is our interposed codes to save the context to local_context.
If (! GDK_IS_WINDOW (window ))
Return;
G_object_set_data (G_OBJECT (context), "window", window );
Int width = gdk_window_get_width (window );
Int height = gdk_window_get_height (window );
If (width! = 0 & height! = 0 ){
Gtk_im_context_focus_in (context );
Local_context = context;
}
// Only add this event_filter when using 'fcitx' immodule.
// For xim immodule, this function is as same as original from gtk2.
Const gchar * immodule = g_getenv ("GTK_IM_MODULE ");
If (immodule &&! Strcmp (immodule, "fcitx ")){
Gdk_window_add_filter (window, event_filter, context );
}
}

/* Below codes is from whitequark, fix for xim immodule */

/* See gtkimcontextxim. c */
GType gtk_type_im_context_xim = 0;

# Define GTK_TYPE_IM_CONTEXT_XIM (gtk_type_im_context_xim)
# Define GTK_IM_CONTEXT_XIM (obj) (G_TYPE_CHECK_INSTANCE_CAST (obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIM ))
# Define GTK_IM_CONTEXT_XIM_CLASS (klass) (G_TYPE_CHECK_CLASS_CAST (klass), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass ))
# Define GTK_IS_IM_CONTEXT_XIM (obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj), GTK_TYPE_IM_CONTEXT_XIM ))
# Define GTK_IS_IM_CONTEXT_XIM_CLASS (klass) (G_TYPE_CHECK_CLASS_TYPE (klass), GTK_TYPE_IM_CONTEXT_XIM ))
# Define GTK_IM_CONTEXT_XIM_GET_CLASS (obj) (G_TYPE_INSTANCE_GET_CLASS (obj), GTK_TYPE_IM_CONTEXT_XIM, GtkIMContextXIMClass ))

Typedef struct _ GtkIMContextXIM;
Typedef struct _ GtkIMContextXIMClass;

Struct _ GtkIMContextXIMClass
{
GtkIMContextClass parent_class;
};

Typedef struct _ StatusWindow;
Typedef struct _ GtkXIMInfo;

Struct _ GtkIMContextXIM
{
GtkIMContext object;

GtkXIMInfo * im_info;

Gchar * locale;
Gchar * mb_charset;

GdkWindow * client_window;
GtkWidget * client_widget;

/* The status window for this input context; we claim
** Status window when we are focused and have created an XIC
**/
StatusWindow * status_window;

Gint preedit_size;
Gint preedit_length;
Gunichar * preedit_chars;
XIMFeedback * feedbacks;

Gint preedit_cursor;

XIMCallback preedit_start_callback;
XIMCallback preedit_done_callback;
XIMCallback preedit_draw_callback;
XIMCallback preedit_caret_callback;

XIMCallback status_start_callback;
XIMCallback status_done_callback;
XIMCallback status_draw_callback;

XIMCallback string_conversion_callback;

XIC ic;

Guint filter_key_release: 1;
Guint use_preedit: 1;
Guint finalizing: 1;
Guint in_toplevel: 1;
Guint has_focus: 1;
};

Static GClassInitFunc orig_gtk_im_context_xim_class_init;
Static GType (* orig_g_type_module_register_type) (GTypeModule *,
GType, const gchar *,
Const GTypeInfo *, GTypeFlags );
Static gboolean (* orig_gtk_im_context_xim_filter_keypress) (GtkIMContext * context,
GdkEventKey * event );

Static gboolean
Hook_gtk_im_context_xim_filter_keypress (GtkIMContext * context, GdkEventKey * event ){
GtkIMContextXIM * im_context_xim = GTK_IM_CONTEXT_XIM (context );
If (! Im_context_xim-> client_window ){
DEBUG ("im_context_xim = % pn", im_context_xim );
DEBUG ("event-> window ==% pn", event-> window );

Gtk_im_context_set_client_window (context, event-> window );
}

Return orig_gtk_im_context_xim_filter_keypress (context, event );
}

Static void
Hook_gtk_im_context_xim_class_init (GtkIMContextXIMClass * class ){
Orig_gtk_im_context_xim_class_init (class, NULL);/* wat? */

GtkIMContextClass * im_context_class = GTK_IM_CONTEXT_CLASS (class );

Assert (! Orig_gtk_im_context_xim_filter_keypress );
Orig_gtk_im_context_xim_filter_keypress = im_context_class-> filter_keypress;
Im_context_class-> filter_keypress = hook_gtk_im_context_xim_filter_keypress;
DEBUG ("orig_gtk_im_context_xim_filter_keypress: % pn ",
Orig_gtk_im_context_xim_filter_keypress );
}

GType
G_type_module_register_type (GTypeModule * module,
GType parent_type,
Const gchar * type_name,
Const GTypeInfo * type_info,
GTypeFlags flags ){
If (! Orig_g_type_module_register_type ){
Orig_g_type_module_register_type = dlsym (RTLD_NEXT, "g_type_module_register_type ");
Assert (orig_g_type_module_register_type );
}

If (type_name &&! Strcmp (type_name, "GtkIMContextXIM ")){
Assert (! Orig_gtk_im_context_xim_class_init );
Orig_gtk_im_context_xim_class_init = type_info-> class_init;

Assert (sizeof (GtkIMContextXIM) = type_info-> instance_size );

Const GTypeInfo hook_im_context_xim_info =
{
Type_info-> class_size,
Type_info-> base_init,
Type_info-> base_finalize,
(GClassInitFunc) hook_gtk_im_context_xim_class_init,
Type_info-> class_finalize,
Type_info-> class_data,
Type_info-> instance_size,
Type_info-> n_preallocs,
Type_info-> instance_init,
};

DEBUG ("orig_gtk_im_context_xim_class_init: % pn", orig_gtk_im_context_xim_class_init );

Gtk_type_im_context_xim =
Orig_g_type_module_register_type (module, parent_type, type_name,
& Hook_im_context_xim_info, flags );

Return gtk_type_im_context_xim;
}

Return orig_g_type_module_register_type (module, parent_type, type_name, type_info, flags );
}

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.