elementary os Freya安装后的一些配置

1、更新源和安装更新

sudo apt-get update
sudo apt-get upgrade

2、安装bumblebee

sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic

用于nvidia独显驱动和管理(仅限nvidia独立显卡)

3、修改plank主题和dock所在位置

cd cd ~/.config/plank/dock1/
vim settings   //如果没有安装vim使用 sudo apt-get install vim 后继续操作,也可以用其他的一些编辑工具来完成

以下是需要修改的地方:

#The position for the dock on the monitor.  If 0, left.  If 1, right.  If 2, top.  If 3, bottom.
Position=0   //默认是3

#The name of the dock's theme to use.
Theme=Transparent  //默认是GTK+,主题包存放在 /usr/share/plank/theme下

4、禁用访客模式

cd /usr/share/lightdm/lightdm.conf.d/
sudo vim 50-no-guest.conf

将以下内容添加进这个文件(系统默认没有这个文件)

[SeatDefaults]
allow-guest=falsen

:wq保存退出,重启即可完成

或者使用一句代码:

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

来完成,执行完后重启即可

5、安装搜狗输入法

先将ibus输入法卸载

sudo apt-get remove ibus
sudo apt-get autoremove  //可选,用于系统删除和卸载不需要的安装包

然后直接去搜狗linux官网下载:http://pinyin.sogou.com/linux/?r=pinyin

根据自己系统来下载,下载完后直接点击安装即可

6、安装wps
直接去官网下载安装包:http://community.wps.cn/download/
完后直接点击安装即可完成

7、安装chrome

sudo apt-get install google-chrome-stable

安装flash player

sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --install

8、修改hosts
具体hosts内容可以参考:
1、http://www.360kb.com/kb/2_150.html
2、http://laod.cn/hosts/2015-google-hosts.html

我用的第一个

cd /etc/
sudo vim hosts

将参考网址中的dns解析内容放进hosts文件,:wq保存退出

9、安装sublime text 3

先直接从官网下载deb包安装:http://www.sublimetext.com/3

安装后不能使用中文,通过以下方法解决:

先安装编译环境:

sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev

在~目录下(目录随意)新建sublime_imfix.c,将以下代码复制进去:

#include <gtk/gtkimcontext.h>
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);
     g_object_set_data(G_OBJECT(context),"window",window);
     if(!GDK_IS_WINDOW (window))
       return;
     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);
}

将上一步的代码编译成共享库libsublime-imfix.so,命令

gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC

然后将libsublime-imfix.so拷贝到sublime_text所在文件夹

sudo mv libsublime-imfix.so /opt/sublime_text/

修改文件/usr/bin/subl的内容

sudo vim /usr/bin/subl

#!/bin/sh
exec /opt/sublime_text/sublime_text "$@"

修改为

#!/bin/sh
LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text "$@"

现在可以通过终端subl启动sublime使用中文输入,但是桌面点击还需进行以下配置:

sudo vim /usr/share/applications/sublime_text.desktop

删除里边的内容,用以下内容覆盖,担心出问题则先进行配置文件备份

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text %F"
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;

[Desktop Action Window]
Name=New Window
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text -n"
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text --command new_file"
OnlyShowIn=Unity;

保存后,如果sublime的图标固定在dock上,则图标会失效,需要重新固定,通过终端输入subl进行启动后固定,关闭后,通过鼠标点击也可进行中文输入。

安装Package Control,通过其来安装ConvertToUTF8,使其能够支持中文显示

View-Show Console,将以下代码贴入输入框:

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

重启Sublime Text 3。
如果在Perferences->package settings中看到package control这一项,则安装成功。

若以上代码无法起作用,可以进行手动安装,步骤如下:

1.点击Preferences > Browse Packages菜单

2.进入打开的目录的上层目录,然后再进入Installed Packages/目录

3.下载Package Control.sublime-package并复制到Installed Packages/目录

4.重启Sublime Text。

按下Ctrl+Shift+P调出命令面板
输入install 调出 Install Package 选项并回车,然后在列表中选中要安装的插件(convertToUTF8)进行安装,完成后打开中文字符集变正常了。

当然可能会出现以下错误:

Encoding: GB2312
Error: Codecs missing

Please install Codecs33 plugin (https://github.com/seanliang/Codecs33/tree/linux-x64).

则需要安装这个插件:

cd ~/.config/sublime-text-3/Packages/
git clone git clone https://github.com/seanliang/Codecs33/tree/linux-x64/ Codecs33

或者直接去github下载这个zip资源,将解压后的资源复制到~/.config/sublime-text-3/Packages/ 下
重启后即可

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值