我发现 2002-05-12(版本 2022.1.1)上的 pyCharm 更新严重影响了鼠标滚轮滚动。
我如何回到以前的版本?
我发现 2002-05-12(版本 2022.1.1)上的 pyCharm 更新严重影响了鼠标滚轮滚动。
我如何回到以前的版本?
lsblk
排序顺序lsblk
以难以遵循的顺序对分区进行排序。一种无需编写 bash 脚本或 python 脚本即可对其进行排序的方法将是首选。
在 Unix 和 Linux 中也提出了类似的问题:
但是,使用-x NAME
参数进行排序的答案会导致树缩进消失。
这是lsblk
现在的显示方式:
$ lsdrv
NAME FSTYPE LABEL MOUNTPOINT SIZE MODEL
nvme0n1 477G Samsung SSD 960 PRO 512GB
├─nvme0n1p9 swap [SWAP] 7.9G
├─nvme0n1p7 ext4 Old_Ubuntu_16.04 /mnt/old 23.1G
├─nvme0n1p5 ntfs 859M
├─nvme0n1p3 16M
├─nvme0n1p1 ntfs 450M
├─nvme0n1p8 ntfs Shared_WSL+Linux /mnt/e 9G
├─nvme0n1p10 ext4 Ubuntu_18.04 /mnt/clone 27.2G
├─nvme0n1p6 ext4 New_Ubuntu_16.04 / 45.1G
├─nvme0n1p4 ntfs NVMe_Win10 /mnt/c 363.2G
└─nvme0n1p2 vfat /boot/efi 99M
mmcblk0 119.1G
└─mmcblk0p1 vfat SANDISK128 /media/rick/SANDISK128 119.1G
sr0 1024M DVD+/-RW DW316
sda 931.5G HGST HTS721010A9
├─sda4 ntfs WINRETOOLS 450M
├─sda2 128M
├─sda5 ntfs Image 11.4G
├─sda3 ntfs HGST_Win10 /mnt/d 919G
└─sda1 vfat ESP 500M
这是它lsblk
应该如何排序:
$ lsdrv
NAME FSTYPE LABEL MOUNTPOINT SIZE MODEL
nvme0n1 477G Samsung SSD 960 PRO 512GB
├─nvme0n1p1 ntfs 450M
├─nvme0n1p2 vfat /boot/efi 99M
├─nvme0n1p3 16M
├─nvme0n1p4 ntfs NVMe_Win10 /mnt/c 363.2G
├─nvme0n1p5 ntfs 859M
├─nvme0n1p6 ext4 New_Ubuntu_16.04 / 45.1G
├─nvme0n1p7 ext4 Old_Ubuntu_16.04 /mnt/old 23.1G
├─nvme0n1p8 ntfs Shared_WSL+Linux /mnt/e 9G
├─nvme0n1p9 swap [SWAP] 7.9G
└─nvme0n1p10 ext4 Ubuntu_18.04 /mnt/clone 27.2G
mmcblk0 119.1G
└─mmcblk0p1 vfat SANDISK128 /media/rick/SANDISK128 119.1G
sr0 1024M DVD+/-RW DW316
sda 931.5G HGST HTS721010A9
├─sda1 vfat ESP 500M
├─sda2 128M
├─sda3 ntfs HGST_Win10 /mnt/d 919G
├─sda4 ntfs WINRETOOLS 450M
└─sda5 ntfs Image 11.4G
注意: lsdrv
是在 中定义的别名~/.bashrc
:
$ alias lsdrv
alias lsdrv='lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL |egrep -v "^loop"'
更改排序顺序的复杂性是:
├─
并└─
在其驱动器下排序。├─
替换为└─
.└─
替换为├─
.10
之后,然后1
是 EG 。真的应该出现在眼前。1
10
2
9
10
多年来,排序顺序lsblk
一直是个难题。希望有人有一个简单的 GNU 实用程序解决方案,例如:、、awk
和/或等。sed
grep
uniq
sort
我的每日备份崩溃了,因为存在一个 30 MB 的“坏”文件,导致我超过了 25 MB 的每日备份限制:
-rw-rw-r-- rick/rick 29018177 2021-08-09 23:07 .config/mserve/ipc.pickle
我已经删除了该文件,但是如何调用 tell cron/etc/cron.daily
再次运行作业?
多年来,我在 Ubuntu 16.04 LTS 中一直使用相同的设置。今天早上突然没有互联网访问,除非我关闭WiFi。我只能在关闭 WiFi 或以太网的情况下访问。
我已经多次重启笔记本电脑,运行sudo apt update && sudo apt upgrade
,重启路由器并查看路由器配置:
WiFi卡的“DHCP-Reserved”设置很突出。我所有的 IP 地址都是静态的:
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 alien
# Add to router static IP address list
192.168.0.10 alien AW 17R3 WiFi 9c:b6:d0:10:37:f7
192.168.0.12 alien AW 17R3 Ethernet 28:f1:0e:2a:1a:ed
192.168.0.11 phone Moto E4 Plus d0:77:14:c8:bc:e5
192.168.0.13 dell Inspiron 17R-SE-7720 Ethernet 5c:f9:dd:5c:9c:53
192.168.0.14 dell Inspiron 17R-SE-7720 WiFi 60:6c:66:86:de:bd
192.168.0.15 hs100 Sony TV Wall Light 50:d4:f7:eb:41:35
192.168.0.16 android-47cdabb50f83a5ee Sony Bravia TV KBL 50W800C
192.168.0.17 hs103 Toshiba 32" TV 18:4F:32:8D:AA:97
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
以太网和 Wifi 卡:
$ lspci -v | grep -i net -A6
3b:00.0 Ethernet controller: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller (rev 10)
Subsystem: Device 0707:2400
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at dd600000 (64-bit, non-prefetchable) [size=256K]
I/O ports at d000 [size=128]
Capabilities: <access denied>
Kernel driver in use: alx
--
3c:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
Subsystem: Bigfoot Networks, Inc. QCA6174 802.11ac Wireless Network Adapter
Flags: bus master, fast devsel, latency 0, IRQ 137
Memory at dd200000 (64-bit, non-prefetchable) [size=2M]
Capabilities: <access denied>
Kernel driver in use: ath10k_pci
Kernel modules: ath10k_pci
不确定路由是否相关,但这里是:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 enp59s0
0.0.0.0 192.168.0.1 0.0.0.0 UG 600 0 0 wlp60s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp59s0
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp59s0
192.168.0.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp60s0
问题是当以太网和 WiFi 都连接时,DNS 查找不起作用。可通过直接 IP 寻址访问 Internet。当 Wifi 和以太网都连接时查看路由器的值似乎在变化?
所以现在我将进入 DNS 兔子洞......
我想知道从 2021 年 4 月到2024年获得 Ubuntu 16.04 LTS 支持需要采取的确切步骤。
我已经阅读了有关扩展安全维护 (ESM)的信息,这听起来是一个可行的选择。
任何人都可以详细说明需要采取的确切步骤以及产生的费用吗?
我在设置时遇到了这个命令ssh
:
$ w
20:01:30 up 6 days, 2:20, 3 users, load average: 0.06, 0.11, 0.10
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
rick tty7 :0 16Jun20 6days 16:51 2.37s /sbin/upstart --user
rick pts/21 192.168.0.12 18:44 1:14m 0.19s 0.00s sleep 60
rick pts/22 192.168.0.12 18:45 0.00s 0.44s 0.01s w
这让我想知道 Ubuntu 中所有的单字母命令是什么。我没有找到确切的参考,但我找到了这个网站:
此处w
列出了该命令以及:
.
获取我使用过的文件的命令v
是 Ubuntu 中未安装的命令。据说相当于ls -l -b
。这又类似于 Ubuntu 的别名设置,除了不包括以(包括臭名昭著的和)ll
开头的文件。.
.
..
Ubuntu中是否默认安装了其他单字母命令?
我想这更像是一个问题,我该去哪里了解何时在 Ubuntu 中发布xrandr
版本?1.5.1
它已经在 Arch Linux 中可用,并于 2019 年 8 月发布。我想修复 2010 年的一个错误。
Ubuntu 16.04.6 LTS 当前版本为:
$ xrandr --version
xrandr program version 1.5.0
Server reports RandR version 1.5
我对这个主题并不精通,但我可以简单地获取1.5.1
源代码并编译它吗?xrandr
还是应该永远不要从源代码编译这样的关键任务应用程序?
每个人都可以在他们的平台上尝试这些简短的小测试,以了解xrandr
版本和 gamma 错误的重要性。
当前的 Ubuntu 版本存在已经存在 9 年的错误:
$ xrandr --version
xrandr program version 1.5.0
Server reports RandR version 1.5
基本问题是xrandr
报告错误的伽马值:
$ xrandr --verbose | grep ^DP-1-1 -A5
DP-1-1 connected 3840x2160+1920+0 (0xa5) normal (normal left inverted right x axis y axis) 1600mm x 900mm
Identifier: 0x43
Timestamp: 538179391
Subpixel: unknown
Gamma: 1.0:1.1:1.3
Brightness: 0.63
我的“类红移”应用程序已将 gamma 设置为Red = 1.0
、Green =.88
和Blue =.77
但 RGB 被错误地报告为1.0:1.1:1.3
. 现在成像我们想要将亮度增加到 0.65。如果我们不同时更改 gamma,现有的 gamma 设置将重置为1:1:1
. 所以我们传递我们认为的当前值:
$ xrandr --output DP-1-1 --brightness .65 --gamma 1.0:1.1:1.3
低,看屏幕变成超级蓝绿色,并杀死我们的红色色调的夜间设置。当我们再次检查当前设置时,我们发现值再次反转:
$ xrandr --verbose | grep ^DP-1-1 -A5
DP-1-1 connected 3840x2160+1920+0 (0xa5) normal (normal left inverted right x axis y axis) 1600mm x 900mm
Identifier: 0x43
Timestamp: 541629314
Subpixel: unknown
Gamma: 1.0:0.91:0.77
Brightness: 0.65
因此,无论xrandr --verbose
报告什么值,我们总是必须使用1 / gamma
才能在红色、绿色和蓝色通道上获得真正的伽马。更正我们的代码后,我们必须对版本进行测试1.5.1
以不更正我们的代码并使用返回的 gamma 值。假设该错误已在1.5.1
我尚未编译和测试的版本中修复。
我曾想过在 Stackoverflow 上问这个问题,但所有“夜灯”参考都是针对 Windows 10 夜灯的。太糟糕了,微软和 Gnome 开发人员并没有为谁将他们的应用程序称为“Blueshift”或其他什么东西而吸管。
除了序言...如何获取 Night Light(Gnome 版本)的源代码?是否还需要 Mutter 和 dconf / gsettings 的源代码?
我知道有不同的版本 3.34.1、3.35.1 和 3.36 beta:
有这个问题:
其中有很多答案。在问题的正文中,OP 询问如何mount
通过 WiFi 访问 android 文件系统,这是我想要做的。然而,没有一个答案包含该mount
命令。
如何mount
通过 WiFi 将手机进行外部存储,以便我可以使用该ls
命令并专门获取每个文件的最后访问时间的结果?
而不是“漂亮”的 GUI 图片,我更喜欢带有命令mount
的 CLI,而不是像/phone
. 然后像这样的命令ls /phone
实际上有效。
不需要通过 GUI 复制和粘贴文件。只是简单的ls
命令。最简单的方法是目标。
您可以在 Ubuntu 中使用许多 FTP 客户端工具。然而,它们带有自己的一组在解释器中运行的类似 shell/bash 的命令。我想使用常规的 bash/shell 命令并从/etc/cron.daily
.
每天早上一个 Cron 作业都会自动mount
拨打电话。然后轮询数千个文件的上次访问时间。umount
然后用最后四个访问时间和电话更新 bash 数组。
除了每天早上恢复笔记本电脑之外,不应该有任何/etc/cron.daily
用户输入,无论如何这已经为其他工作完成了。
我有这个有效的代码:
# Hide irrelevant errors so chrome doesn't email us in cron
if [[ $fCron == true ]] ; then
google-chrome --headless --disable-gpu --dump-dom \
"$RobWebAddress" > "$DownloadName" 2>/dev/null
else
# Get silly error messages when running from terminal
google-chrome --headless --disable-gpu --dump-dom \
"$RobWebAddress" > "$DownloadName"
fi
如果我尝试像这样缩短它:
# Hide irrelevant errors so chrome doesn't email us in cron
local HideErrors
[[ $fCron == true ]] && HideErrors="2>/dev/null"
google-chrome --headless --disable-gpu --dump-dom \
"$RobWebAddress" > "$DownloadName" "$HideErrors"
我收到错误消息:
[0826/043058.634775:ERROR:headless_shell.cc(597)] Open multiple tabs is only supported when remote debugging is enabled.
[0826/043058.672587:ERROR:headless_shell.cc(597)] Open multiple tabs is only supported when remote debugging is enabled.
[0826/043058.711640:ERROR:headless_shell.cc(597)] Open multiple tabs is only supported when remote debugging is enabled.
(... SNIP ...)
为什么硬编码的参数可以工作,但不能将参数作为变量?
目前,我通过第二个答案的替代建议找到了成功:
# Redirect errors when cron is used to /dev/null to reduce emails
ErrorPipe=/dev/stderr
[[ $fCron == true ]] && ErrorPipe=/dev/null
google-chrome --headless --disable-gpu --dump-dom \
"$RobWebAddress" > "$DownloadName" 2>"$ErrorPipe"
基于第一个答案,我应该指出程序头已经包含:
[[ $fCron != true ]] &&
exec 2> >(grep -v 'GtkDialog mapped without a transient parent' >&2)
使用wget
我下载了这个网页:
使用命令:
RobWebsiteAddress="https://www.walmart.ca/en/ip/Dispenser-Set-Tumbler-Organizer-Bathroom-Bin-Holder-Bathroom-Containers-Soap-Set-Accessories-Travel-6Pcs-Accessory-Ejoyous-Dish-Toothbrush/PRD4406MV3EZF75"
DownloadName="Ejoyous1"
wget -O- -q --user-agent=AGENT "$RobWebAddress" > "$DownloadName"
当我尝试打开其中的文件时,gedit
它变得疯狂。
当我使用:
grep -i 23.31 Ejoyous1 | wc
0 0 0
价格没找到。如果我grep
在这个词上price
得到一长行的 146,329 个字符,这可能是让我gedit
发疯的原因:
$ grep -i price Ejoyous1 | wc
1 6292 146329
.5 MB 文件中有一些提示:
$ grep -i necolas Ejoyous1
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
如您所知,这是来自沃尔玛的网站。只需下载网页并使用它,我就可以毫无问题地获得 Costco 的定价和 Ikea 的定价wget
。我也没有问题查看从 Costco 或 Ikea 下载的文件gedit
。
如果它是 HTML 的衍生物,我该如何解释这种语言?我应该使用什么工具?有什么线索可以走上正确的道路吗?
我正努力勇敢地迈入“apt-world”,今晚在克隆上测试从 16.04 升级到 19.04 时遇到了这些错误(这......好吧......复杂......):
The following packages have unmet dependencies:
indicator-bluetooth : Depends: unity-control-center but it is not going to be installed or
gnome-control-center but it is not going to be installed or
ubuntu-system-settings but it is not installable
libdouble-conversion1v5 : Conflicts: libdouble-conversion1 but 3.1.0-2 is to be installed
Breaks: libdouble-conversion1 but 3.1.0-2 is to be installed
libqt5dbus5 : Depends: qtbase-abi-5-5-1
libqt5network5 : Depends: qtbase-abi-5-5-1
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
有谁知道如何解决这些错误或我可以提供哪些其他信息来帮助解决这些错误?
16.04 到 19.04 升级是通过脚本进行的,因此如果有帮助,我可以预先安装软件包。我已经重新克隆了 16.04 并运行了五次脚本来解决其他错误,现在我几乎可以看到隧道尽头的曙光了。
目前只有 Unity Desktop 通过升级安装和转换。成功升级后,我计划安装 Gnome Desktop 和可能的 Wayland。
我甚至在升级之前就看到了一个问题:
$ sudo dpkg -P libdouble-conversion1v5
dpkg: dependency problems prevent removal of libdouble-conversion1v5:amd64:
libqt5qml5:amd64 depends on libdouble-conversion1v5 (>= 2.0.0).
dpkg: error processing package libdouble-conversion1v5:amd64 (--purge):
dependency problems - not removing
Errors were encountered while processing:
libdouble-conversion1v5:amd64
另一个项目要求:
$ apt list --installed | grep hw
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
hwdata/xenial-updates,xenial-updates,now 0.267-1ubuntu2 all [installed]
linux-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed]
linux-headers-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed]
linux-hwe-tools-4.15.0-54/xenial-updates,xenial-security,now 4.15.0-54.58~16.04.1 amd64 [installed,automatic]
linux-hwe-tools-4.15.0-55/xenial-updates,xenial-security,now 4.15.0-55.60~16.04.2 amd64 [installed,automatic]
linux-image-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed,automatic]
linux-signed-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed]
linux-signed-image-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed]
linux-tools-generic-hwe-16.04/xenial-updates,xenial-security,now 4.15.0.55.76 amd64 [installed,automatic]
lshw/xenial-updates,now 02.17-1.1ubuntu3.6 amd64 [installed]
xserver-xorg-core-hwe-16.04/xenial-updates,xenial-security,now 2:1.19.6-1ubuntu4.1~16.04.2 amd64 [installed]
xserver-xorg-hwe-16.04/xenial-updates,now 1:7.7+16ubuntu3~16.04.1 amd64 [installed]
xserver-xorg-input-all-hwe-16.04/xenial-updates,now 1:7.7+16ubuntu3~16.04.1 amd64 [installed]
xserver-xorg-input-evdev-hwe-16.04/xenial-updates,now 1:2.10.5-1ubuntu1~16.04.1 amd64 [installed]
xserver-xorg-input-synaptics-hwe-16.04/xenial-updates,now 1.9.0-1ubuntu1~16.04.1 amd64 [installed]
xserver-xorg-input-wacom-hwe-16.04/xenial-updates,now 1:0.34.0-0ubuntu2~16.04.1 amd64 [installed]
xserver-xorg-legacy-hwe-16.04/xenial-updates,xenial-security,now 2:1.19.6-1ubuntu4.1~16.04.2 amd64 [installed,automatic]
xserver-xorg-video-all-hwe-16.04/xenial-updates,now 1:7.7+16ubuntu3~16.04.1 amd64 [installed]
xserver-xorg-video-amdgpu-hwe-16.04/xenial-updates,now 18.0.1-1~16.04.1 amd64 [installed]
xserver-xorg-video-ati-hwe-16.04/xenial-updates,now 1:18.0.1-1~16.04.1 amd64 [installed]
xserver-xorg-video-fbdev-hwe-16.04/xenial-updates,now 1:0.4.4-1build6~16.04.1 amd64 [installed]
xserver-xorg-video-intel-hwe-16.04/xenial-updates,now 2:2.99.917+git20171229-1~16.04.1 amd64 [installed]
xserver-xorg-video-nouveau-hwe-16.04/xenial-updates,now 1:1.0.15-2~16.04.1 amd64 [installed]
xserver-xorg-video-qxl-hwe-16.04/xenial-updates,now 0.1.5-2build1~16.04.1 amd64 [installed]
xserver-xorg-video-radeon-hwe-16.04/xenial-updates,now 1:18.0.1-1~16.04.1 amd64 [installed]
xserver-xorg-video-vesa-hwe-16.04/xenial-updates,now 1:2.3.4-1build3~16.04.1 amd64 [installed]
xserver-xorg-video-vmware-hwe-16.04/xenial-updates,now 1:13.2.1-1build1~16.04.1 amd64 [installed]
我可能会因包裹被扣留而受苦:
因为所有三个包都存在于16.04他们只是没有升级到19.04:
$ apt list unity-control-center
Listing... Done
unity-control-center/xenial-updates,now 15.04.0+16.04.20171130-0ubuntu1 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
$ apt list libqt5core5a
Listing... Done
libqt5core5a/xenial-updates,xenial-security,now 5.5.1+dfsg-16ubuntu7.6 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
$ apt list libdouble-conversion1v5
Listing... Done
libdouble-conversion1v5/xenial,now 2.0.1-3ubuntu2 amd64 [installed]
链接中的答案有很多建议,下班后我会尝试的第一个是:
sudo apt-get --with-new-pkgs upgrade
在 Linux 中,您可以:
ls Filename*
rm Filename*
mv Filename* /New/Directory
cp Filename* *.bak
cp
命令以复制文件组我有一组文件要复制,而无需逐个输入名称并使用以下cp
命令:
$ ls gmail-meta3*
gmail-meta3 gmail-meta3-REC-1558392194-26467821
gmail-meta3-LAB-1558392194-26467821 gmail-meta3-YAD-1558392194-26467821
如何使用旧的 DOS 命令之类的东西copy gmail-meta3* *.bak
?
我不想四次输入类似的命令:
cp gmail-meta3-LAB-1558392194-26467821 gmail-meta3-LAB-1558392194-26467821.bak
我正在寻找一个脚本/函数/应用程序,它接受新旧文件名组的参数,而不是带有硬编码文件名的东西。例如,用户可以键入:
copy gmail-meta3* *.bak
或者他们可能会输入:
copy gmail-meta3* save-*
我有这个shellcheck
警告,我无法弄清楚:
In /mnt/e/bin/iconic line 540:
printf "FALSE|" >> "$IconsRaw" # Select field number 1
^-- SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.
我注意到我们这里的许多人都使用shellcheck来修复我们的 bash 脚本/shell 命令,所以我希望这个问题是关于主题的。
根据发布 bash 脚本相关部分的评论:
if [[ "$X" == "?" || "$Y" == "?" ]] ; then
: # Bad X or Y offset usually "Link to Name.ext~" (backup name)
else
let i++
printf "FALSE|" >> "$IconsRaw" # Select field number 1
printf "%s|" "$i" >> "$IconsRaw" # 2
printf "%s|" "${File##*/}" >> "$IconsRaw"
printf "%s|" "$Linkless" >> "$IconsRaw" # 4
printf "%s|" "$Date" >> "$IconsRaw" # 5
printf "%s|" "$X" >> "$IconsRaw" # 6
echo "$Y" >> "$IconsRaw" # 7
fi
感谢接受的答案和评论,我了解到shellcheck
不仅可以捕获代码中的错误,还可以建议性能改进。在这种情况下,文件名被每个和$IconsRaw
多次打开和关闭。printf
echo
更高效的 bash 代码:
# X,Y screen coordinates invalid on backup files ending with "~"
! [[ "$X" == "?" || "$Y" == "?" ]] && { let i++; echo \
"FALSE|$i|${File##*/}|$Linkless|$Date|$X|$Y" >> "$IconsRaw"; }
听起来很简单;xdotool
选择桌面,模拟F5按键并将焦点返回到调用窗口/程序。
谷歌搜索后,虽然它听起来不再简单了。
我需要从 bash / gnome-shell 执行此操作。
有任何想法吗?
这个项目与这个问答有关,由于不同尺寸的显示器,图标从左屏幕下降到一个黑色的整体:
感谢Podesta 的帮助,我创建了以下代码:
TestIcons () {
[[ $TestSeconds == "" ]] || [[ $TestSeconds == 0 ]] && TestSeconds=5
local i Position File
for (( i=0; i<${#IconsArr[@]}; i=i+ICON_FLD_CNT )) ; do
File="$ICONS_DIR"/"${IconsArr[((i+ICON_NAME_NDX))]}"
Position="${IconsArr[((i+ICON_COL_NDX))]},${IconsArr[((i+ICON_ROW_NDX))]}"
gvfs-set-attribute -t string "$File" \
'metadata::nautilus-icon-position' "$Position"
done
wmctrl -k on # Show desktop
xdotool key F5 # Refresh desktop (show icon new positions)
sleep $TestSeconds # Pause for view
wmctrl -k off # Restore windows
for (( i=0; i<${#OldIconsArr[@]}; i=i+ICON_FLD_CNT )) ; do
File="$ICONS_DIR"/"${OldIconsArr[((i+ICON_NAME_NDX))]}"
Position="${OldIconsArr[((i+ICON_COL_NDX))]},${OldIconsArr[((i+ICON_ROW_NDX))]}"
gvfs-set-attribute -t string "$File" \
'metadata::nautilus-icon-position' "$Position"
done
wmctrl -k on # Show desktop
xdotool key F5 # Refresh desktop (show icon new positions)
wmctrl -k off # Restore windows
} # TestIcons
这是屏幕的样子:
这是一个自我回答的问题。请看下面我的回答。
这是我的多显示器配置:
$ xrandr --current | grep " connected"
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1107mm x 623mm
eDP-1-1 connected primary 1920x1080+3840+2160 (normal left inverted right x axis y axis) 382mm x 215mm
DP-1-1 connected 3840x2160+1920+0 (normal left inverted right x axis y axis) 1600mm x 900mm
监视器设置的 GUI 视图是:
以前索尼电视显示器上的桌面图标包装正确:
+---------+ +---------+
| Icon 1 | | Icon 7 |
+---------+ +---------+
| Icon 2 | | Icon 8 |
+---------+ +---------+
| Icon 3 | | Icon 9 |
+---------+ +---------+
| Icon 4 | | Icon 10 |
+---------+ +---------+
| Icon 5 | | Icon 11 |
+---------+ +---------+
| Icon 6 |
+---------+
购买东芝电视后,第二列图标消失了,第一列被截断:
+---------+
| Icon 1 |
+---------+
| Icon 2 |
+---------+
| Icon 3 |
+---------+
| Icon 4 |
+---------+
| Icon 5 |
+---------+
| Icon 6 |
+---------+
| Icon 7 |
虽然索尼电视的高度为 1080 像素,但当与东芝电视右下方的笔记本电脑显示器(另外 1080 像素)结合使用时,桌面管理器似乎使用 4320虚拟像素来放置图标。
如何使用显示器大小而不是虚拟屏幕大小在桌面上放置图标?
有时我在左显示器上观看全屏视频,如何将图标放置到东芝电视等任何显示器上?
虽然 Python 脚本可以解决问题,但我更喜欢 bash 解决方案,因为我更喜欢修改 bash。
我正在尝试抑制and中的GtkDialog
警告:zenity
yad
$ zenity --error --text hello
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
错误重定向和过滤工作:
$ zenity --error --text hello 2> >(grep -v GtkDialog >&2)
是的...烦人的警告信息消失了!!
这可以~/.bashrc
用于开发工作,如下所示:
和这里:
但是,在创建供其他人使用的脚本时,您不希望他们改变他们的~/.bashrc
.
我在为以下内容创建键入快捷方式时遇到问题:2> >(grep -v GtkDialog >&2)
要在脚本中使用。
由于许多原因,变量赋值GTK_SPAM="2> >(grep -v GtkDialog >&2)"
后跟变量使用"$GTK_SPAM"
不起作用。
alias zenity="zenity 2> >(grep -v GtkDialog >&2)"
在调用脚本之前,但我不能在脚本中使用它。
使用数组来保存输入快捷方式不起作用:
$ aGtkSpam=(2\> \>\(grep -v GtkDialog \>\&2\))
$ DumpArray "${aGtkSpam[@]}"
Array Elements:
0: 2>
1: >(grep
2: -v
3: GtkDialog
4: >&2)
$ zenity --error --text hello "${aGtkSpam[@]}"
This option is not available. Please see --help for all possible usages.
$ yad --text hello 2> >(grep -v GtkDialog >&2)
$ yad --text hello "${aGtkSpam[@]}"
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
我发现了许多关于分词和参数的优秀通用答案,这些答案应该可以解决我的问题,但特定的语法却让我望而却步。
有什么线索吗?
在gnome-terminal
Ubuntu Unity 16.04 LTS 中,该菜单适用于View菜单中的所有三个缩放功能:
只有两个快捷键起作用:
尝试恢复正常大小我发现Ctrl+o或Ctrl+ Shift+O不起作用。这些组合键就像Enter使用了 一样。
$ cat .inputrc
# ~/.inputrc - complements /etc/inputrc - global inputrc for libreadline
# April 15, 2019
# See readline(3readline) and `info rluserman' for more information.
$include /etc/inputrc
# Insert key to togged overwrite-mode
"\e[2~": overwrite-mode
# April 22, 2019 AU Q&A: https://askubuntu.com/q/1135306/307523
# Make Shift-tab act like "cd ../" (move to parent directory)
"\e[Z": "cd ../"
$ cat /etc/inputrc
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
# To allow the use of 8bit-characters like the german umlauts, uncomment
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
# set convert-meta off
# try to enable the application keypad when it is called. Some systems
# need this to enable the arrow keys.
# set enable-keypad on
# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
# do not bell on tab-completion
# set bell-style none
# set bell-style visible
# some defaults / modifications for the emacs mode
$if mode=emacs
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert
# mappings for "page up" and "page down" to step to the beginning/end
# of the history
# "\e[5~": beginning-of-history
# "\e[6~": end-of-history
# alternate mappings for "page up" and "page down" to search the history
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
$if term=rxvt
"\e[7~": beginning-of-line
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word
$endif
# for non RH/Debian xterm, can't hurt for RH/Debian xterm
# "\eOH": beginning-of-line
# "\eOF": end-of-line
# for freebsd console
# "\e[H": beginning-of-line
# "\e[F": end-of-line
$endif
有什么线索吗?