Jack's Blog

流淌的心,怎能阻拦,吹来的风,又怎能阻挡。

发现新大陆--fedora 25 的完美配置

Jacob posted @ Jul 11, 2017 10:02:32 AM in Fedora with tags python fedora 配置 哈工大 , 2968 阅读

Before we go

16年安装了fedora 25,然而由于学校的各种事情,用windows还是比较方便。感到遗憾的是一直没有很好的利用这么好的资源,包括各种开源的软件和强大的环境友好性。

现在我想将自己的工作平台全部转移到Fedora 25上,有几大配置非常有用,我将把他们分享给大家


1.Pycharm edu

自行搜索其官网下载最新版的 pycharm edu 最新版

  1. Unpack the PyCharm Edu distribution archive that you downloaded to
     where you wish to install the program. We will refer to this destination
     location as your {installation home} below.

  2. Open a console and cd into "{installation home}/bin" and type:

       ./pycharm.sh

     to start the application. As a side effect, this will initialize various
     configuration files in the ~/.PyCharmEdu3.5 directory.

  3. [OPTIONAL] Add "{installation home}/bin" to your PATH environment
     variable so that you may start PyCharm Edu from any directory.

  4. [OPTIONAL] To adjust the value of the JVM heap size, create
      ~/.PyCharmEdu3.5/pycharm.vmoptions (or pycharm64.vmoptions
      if using a 64-bit JDK), and set the -Xms and -Xmx parameters. To see how
      to do this, you can reference the vmoptions file under
      "{installation home}/bin" as a model.

  [OPTIONAL] Changing the location of "config" and "system" directories

2.python 3

下载地址:https://www.python.org/downloads/release/python-361/

安装代码:

On Unix, Linux, BSD, macOS, and Cygwin::

    ./configure
    make
    make test
    sudo make install

3.搜狗输入法

安装fedora 中文软件源

$ sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repo 
$ sudo dnf install fzug-release -y
$ sudo dnf install sogoupinyin sogoupinyin-selinux -ysudo dnf install sogoupinyin sogoupinyin-selinux -y
$ reboot

该包已添加 fcitx-gtk2, fcitx-gtk3, fcitx-qt4 和 fcitx-qt5 模块依赖。
注意:由 iBus 切换至 Fcitx 需要 重启/注销 系统,以便 imsettings 启动相应输入法。

FAQ

使用 Sogou Pinyin

如果您使用 XDG 兼容的桌面环境,比如 KDE, GNOME, XFCE, LXDE, Cinnamon。那么当您安装好 Sogou 并重新登录后,Fcitx 和 Sogou 应该会自动启动。使用 Ctrl+Space 激活 Fcitx 便可以输入了,Shift 临时切换中英文。

1). sogou-qimpanel 未自动启动

如果 Fcitx 没有随桌面环境自动启动,请检查 imsettings 设置,正常的配置如下所示:

$ imsettings-info 
Xinput file: /etc/X11/xinit/xinput.d/fcitx.conf
GTK+ immodule: fcitx
Qt immodule: fcitx
XMODIFIERS: @im=fcitx
XIM server: /usr/bin/fcitx -D
Preferences: /usr/bin/fcitx-configtool
Auxiliary:
Short Description: FCITX
Long Description:
Icon file: /usr/share/pixmaps/fcitx.png
Is system default: TRUE
Is user default: TRUE
Is XIM server: FALSE
$ imsettings-switch fcitx  # 切换至 fcitx

如果您的桌面环境不兼容 XDG,则 sogou-qimpanel 不会自动启动。请使用桌面环境自带的自动启动工具,添加 sogou-qimpanel 启动项。

如果您的桌面环境不包含自启动工具,或您使用 startx 脚本启动图形界面,则在 ~/.profile 中添加以下命令。

$ vim ~/.profile
source /etc/sysconfig/sogoupinyin

该脚本在启动 X 时被 /etc/X11/xinit/xinitrc-common 调用,用于设置 Fcitx 环境变量,并启动 sogou-qimpanel

2). 如何安装皮肤

查看帮助信息:

$ rpm -qi sogoupinyin
皮肤保存在~/.config/sogou-qimpanel/skin/, 按以下方式安装:
  $ sudo setsebool sogou_enable_homedirs=1
  $ sogou-qimpanel Skin.ssf

3). 如何安装词库

查看帮助信息:

$ rpm -qi sogoupinyin
词库保存在~/.config/SogouPY/scd/, 按以下方式安装:
  $ sudo setsebool sogou_enable_homedirs=1
  $ sogou-qimpanel Cell.scel

4). 禁止 Sogou 访问网络

查看帮助信息:

$ rpm -qi sogoupinyin
禁止 sogou 访问网络:
  $ sudo setsebool -P sogou_access_network=0 # 默认: true

5). 小黑框问题

Xfce 桌面环境,如遇到小黑框,需开启 Compositor 功能:

Settings -> Windows Manger Tweaks -> Compositor
设置 -> 窗口管理器微调 -> 合成器

Mate 桌面环境,如遇到小黑框,需开启 Compositor 功能:

System -> Control Center -> Windows -> Enable software composit..

LXDE 桌面环境,如遇到小黑框,需要修改窗口管理器。

$ yum install compiz-lxde ccsm
$ vim ~/.config/lxsession/LXDE/desktop.conf
 window_manager=openbox  # 原参数
 window_manager=compiz-lxde-emerald  # 修改为

6). GTK/Qt 程序无法切换输入法

如果遇到无法切换输入法,则检查 Fcitx 环境变量 是否已正确设置。

$ env | grep fcitx
GTK_IM_MODULE=fcitx
QT4_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

对于兼容 XDG 的桌面环境,Fcitx 环境变量应由 imsettings 通过 /etc/X11/xinit/xinputrc 配置。

$ ll /etc/X11/xinit/xinputrc
/etc/X11/xinit/xinputrc -> /etc/alternatives/xinputrc

7). 选词框乱码

如果您碰到了 #79 的问题。可能是您启用了 "轻量界面 (fcitx-ui-light)" ,它会导致 sogou-qimpanel 不能正常显示。在 "输入法配置" -> "附加组件" 中,禁用 "轻量界面" 即可。

PS: 源里的 fcitx-cloudpinyin 可以正常使用 Google 云拼音,有了云拼音 libpinyin 之类的输入法也挺好,内存占用低。

故障排除

  • imsettings:根据 ~/.cache/imsettings/log 日志排查错误
  • Fcitx:运行 fcitx-diagnose 排查 Fcitx 错误
  • Sogou:运行 sogou-diag 收集诊断信息

参考:https://github.com/FZUG/repo/wiki/Sogou-Pinyin-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

4.安装中文软件包源

软件包列表

按 Fedora 版本浏览


Name Lisence Require repo Description
Input Methods
sogoupinyin Proprietary, GPLv2 fedora 搜狗拼音输入法
fcitx-rime GPLv3 fedora 中州韵输入法
fcitx-sunpinyin GPLv2+ fedora sunpinyin 输入法
fcitx-qt5 GPLv2 fedora fcitx qt5 输入模块
Multimedia
kwplayer GPLv3 rpmfusion 酷我音乐
doubanfm-qt MIT rpmfusion 豆瓣FM
musicbox MIT rpmfusion 网易云音乐 CLI
deepin-music-player GPLv3 rpmfusion 深度音乐
moonplayer GPLv3 rpmfusion Moonplayer播放器
simplescreenrecorder GPLv3 rpmfusion 屏幕录像
obs-studio GPLv2 rpmfusion 屏幕录像/流媒体直播
tragtor LGPLv2 rpmfusion FFmpeg音视频转码
Notes / Dict
wiznote GPLv3 fedora 为知笔记 stable
wiznote-beta GPLv3 fedora 为知笔记 beta
youdao-dict Proprietary fedora 有道词典 for linux
Browser / Proxy
opera-developer Proprietary fedora Opera developer
opera-beta Proprietary fedora Opera beta
opera-stable Proprietary fedora Opera stable
freshplayerplugin MIT fedora Firefox PPAPI flash 兼容插件
Downloads
bcloud GPLv3 fedora 百度云客户端
xware-desktop GPLv3 fedora 迅雷客户端
pointdownload GPLv3 fedora 点载, 支持迅雷/BT/ed2k下载
System tools
ccal LGPL fedora 命令行下的农历日历
grub4dos GPLv2 fedora grub 引导管理器
screenfetch GPLv3 fedora 系统信息收集
vim 7.4.764 vim fedora 编辑器之神,增加剪贴板/lua/py3支持
dkms-mt7601u GPL fedora MT7601U USB Wifi 驱动
System libraries
opencc ASL2 fedora 简繁转换库,修正依赖
sunpinyin LGPLv2 fedora 基于 SLM 模型的输入法引擎,更新字典
python-html2text GPLv3 fedora HTML -> ASCII
python3-xlib GPLv2 null Python3 X 库
python3-keybinder GPLv3 null Python3 键绑定库
python-mutagen GPLv2 fedora 处理音频元数据
python3-cairo LGPLv2 fedora Python3 cairo 绑定,修复 bug
pygobject3 LGPLv2+ fedora Python GObject 封装,修复 bug
deepin-ui GPLv3 fedora Deepin UI toolkit
deepin-utils GPLv3 fedora Deepin utils 库
deepin-gsettings GPLv3 fedora gsettings python 绑定
pyjavascriptcore GPLv3 fedora

pyjs

在我们安装完中文软件源后就可以安装很多软件,只需:

dnf install *(相应软件名称)

 

5.安装python 的依赖库

大家在运行python时,肯定不想被缺乏相应的函数库而困扰

我查阅了相应的资料,只需:

 

pip3 install turtle(for example)pip install turtle(for example)
pip install upgrade pip

pip 是Python通用的

而pip 3 是专门为python 3 开发的

6.googel chrome

cat << EOF > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - \$basearch
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
dnf install google-chrome-stable
dnf install google-chrome-beta

Note for Fedora 26/25 Wayland users

If you have problems, then fallback to Xorg with modifying /etc/gdm/custom.conf file:# GDM configuration storage

[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false

[security]
...
Avatar_small
AP SSC Assignment Qu 说:
2022年9月09日 21:49

Department of Government Examinations and Secondary Education Board Andhra Pradesh has conducted the Assignment Exams multiple times in the academic year in Session-1 and Session-2 (Term-1 & Term-2). There are four exams are conducted Assignment-1, Assignment-2, Assignment-3 and Assignment-4. AP SSC Assignment Question Paper Every Class 10th Standard Student Studying in Government & Private Schools in Telugu Medium, English Medium & Urdu Medium can download the AP 10th Assignment Model Paper 2023 with answer solutions for theory, objective and bit questions. Subject experts of the board have designed and introduced the practice question bank for all Part-A, Part-B, Part-C, and Part-D exams.

Avatar_small
CM Rise Digital Shik 说:
2022年10月31日 22:29

Madhya Pradesh CM Rise digital teacher training programme & shikshak prashikshan certificate download: School Education System, Madhya pradesh in collaboration with People samsthan had established a new platform to enhance the knowledge and skill of teachers. CM Rise Digital Shikshak Prashikshan Madhya Pradesh government had started a new digital training programme to enrich the skill of both teachers and students.

Avatar_small
HDFC Credit Card app 说:
2022年11月15日 02:29

Credit cards are a significant payment card used by the cardholder to help to pay bills for goods and services. Today credit card is standard among many Indian citizens who opt to use the card from various merchant payments. HDFC Credit Card application Status check The HDFC Bank offers customers an easy and quick way of applying for a credit card. HDFC customers can apply online using the HDFC website or visit the bank for the offline process.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter