AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-283408

Erik Apostol's questions

Martin Hope
Erik Apostol
Asked: 2020-06-06 00:03:37 +0800 CST

IBus 输入法仅适用于系统搜索

  • 3

刚把Ubuntu从19.10升级到20.04,突然发现用IBus只能在系统搜索(按Super键后出现的搜索栏)和Telegram输入汉字,gedit、Firefox、终端和 Chrome。在这些应用程序中,IBus输入法(ibus-chewing、ibus-pinyin)只能输入英文字符,按Shift在中英文之间切换是不起作用的。

我努力了:

  1. 跟随ArchWiki IBus 页面并添加四行
    export GTK_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    export QT_IM_MODULE=ibus
    export GTK_IM_MODULE_FILE=/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
    
    在我的$HOME/.bashrc; 和
  2. 运行im-config并选择默认配置。

以上都不起作用。

ibus
  • 1 个回答
  • 879 Views
Martin Hope
Erik Apostol
Asked: 2018-01-22 17:36:30 +0800 CST

启动应用程序没有运行我的脚本

  • 4

我在启动应用程序中添加一个项目如下: 编辑启动程序

为了您的方便,我在这里重复命令:

gnome-terminal --command  "sleep 30;export PATH=$PATH:/home/erik/Downloads/geckodriver_dir;python ~/Dropbox/BashScripts/fjucheckin.py"

预计在我进入办公室打开笔记本电脑后,打开一个gnome-terminal,然后运行python脚本fjucheckin.py打开一个Firefox窗口,然后自动代我签到,然后等我按键关闭 Firefox 窗口。但事实证明,没有出现 gnome-terminal 或 Firefox 窗口。

之后,我手动运行上述整个gnome-terminal --command "sleep 30;export PATH=$PATH:/home/erik/Downloads/geckodriver_dir;python ~/Dropbox/BashScripts/fjucheckin.py"命令,一个终端出现并在一秒钟内关闭。没有显示 Firefox 窗口。

我sleep 30;export PATH=$PATH:/home/erik/Downloads/geckodriver_dir;python ~/Dropbox/BashScripts/fjucheckin.py手动运行它,它可以工作。

python脚本fjucheckin.py如下,如果需要的话:

#!/usr/bin/env python
# -*- coding: utf-8 -*- 

import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
#import org.openqa.selenium.support.ui.Select;
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.implicitly_wait(1000) # seconds
driver.get("http://140.136.251.114/Aiamis/Login.aspx")
#assert "Python" in driver.title

#Account
elem = driver.find_element_by_name("ctl00$ContentPlaceHolder$txtAccount")
elem.clear()
elem.send_keys("...")
elem.send_keys(Keys.TAB)
assert "No results found." not in driver.page_source

#Password
elem = driver.find_element_by_name("ctl00$ContentPlaceHolder$txtPwd")
elem.clear()
elem.send_keys("...")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source

#// Get a handle to the open alert, prompt or confirmation
WebDriverWait(driver, 1000).until(EC.alert_is_present())
alert = driver.switch_to.alert;
#// And acknowledge the alert (equivalent to clicking "OK")
alert.accept();

elem = driver.find_element_by_link_text("差勤/日誌填寫");
hover = ActionChains(driver).move_to_element(elem).move_to_element(driver.find_element_by_link_text("專任助理簽到退"));
hover.click().perform();

elem = driver.find_element_by_id("ctl00_ContentPlaceHolder_ddlPlanToday")
Select(elem).select_by_value("500767");

driver.find_element_by_id("ctl00_ContentPlaceHolder_rdSignType_0").click();

elem = driver.find_element_by_id("ctl00_ContentPlaceHolder_txtTodayOther")
elem.clear()
description = u"研究資料整理"
elem.send_keys(description)

driver.find_element_by_id("ctl00_ContentPlaceHolder_btnSignToday").click()

#pause
raw_input()
driver.close()
command-line
  • 1 个回答
  • 1617 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve