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
    • 最新
    • 标签
主页 / ubuntu / 问题

全部问题(ubuntu)

Martin Hope
Oli
Asked: 2024-09-13 16:44:45 +0800 CST

运行上一个带有更改的命令的键盘快捷键?

  • 5

我经常在 Bash 中以交互方式运行一系列管理命令。我会在继续之前阅读响应,但这些链可能需要多次尝试才能让我满意。这些类型的链通常涉及具有多个子命令或“操作”的单个系统:

sudo apt depends package
sudo apt rdepends package
sudo apt purge package
sudo apt install package
systemctl --user status whatever.service
systemctl --user restart whatever.service

“动作”,也就是你实际要做的事情,隐藏在命令的中间。经过近二十年,我仍然需要四个步骤才能从一个命令转到下一个命令:

  1. ↑显示上一个命令
  2. Ctrl+←直到克拉位于正确位置
  3. Alt+Backspace删除一个单词
  4. 键入新的“动作”,然后Return。

我的要求可能看起来有点偷懒,但今天早上我在执行更长的命令时确实遇到过几次这种情况,需要花好几秒钟才能找到替换操作的行。我想知道的是:这真的是最好的吗?

我经常对自己不知道的东西之多感到震惊,因此当我得知有一个我从未听说过的快速内联单词替换快捷方式时,我不会感到太惊讶。

command-line
  • 1 个回答
  • 16 Views
Martin Hope
bragdon
Asked: 2024-09-13 15:35:50 +0800 CST

安装 ubuntu server 22.04 后无法控制旧 HP 台式电脑风扇

  • 5

我在一台大约 10-15 年的旧 HP 台式电脑上安装了 Ubuntu Server 22.04。之前,它运行的是 Windows 7,风扇没有噪音。但现在,由于转速高(约 1300 RPM),风扇发出很大噪音。

我尝试遵循该论坛上不同相关主题的多个答案,但没有成功。因此,我做了以下事情:

  • 安装lm_sensors并运行sudo sensors-detect,我得到以下结果:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

# Generated by sensors-detect on Fri Sep 13 08:03:19 2024
# Chip drivers
coretemp
f71882fg
  • 重启
  • 运行sensors命令:
sensors
f71858fg-isa-0200
Adapter: ISA adapter
+3.3V:         3.36 V  
3VSB:          3.28 V  
Vbat:          3.25 V  
fan1:        1359 RPM
fan2:         945 RPM
fan3:           0 RPM  ALARM
temp1:        +33.9°C  (high = +70.0°C, hyst = +60.0°C)
temp2:        +33.4°C  (high = +100.0°C, hyst = +85.0°C)
temp3:        +31.9°C  (high = +100.0°C, hyst = +85.0°C)

nouveau-pci-0100
Adapter: PCI adapter
GPU core:    900.00 mV (min =  +0.88 V, max =  +1.08 V)
temp1:        +54.0°C  (high = +95.0°C, hyst =  +3.0°C)
                      (crit = +105.0°C, hyst =  +5.0°C)
                      (emerg = +135.0°C, hyst =  +5.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +34.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:        +25.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:        +28.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:        +19.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:        +32.0°C  (high = +80.0°C, crit = +99.0°C)
  • 跑步sudo pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
  hwmon0 is nouveau
  hwmon1 is coretemp
  hwmon2/device is f71858fg
  hwmon3 is hidpp_battery_0

Found the following PWM controls:
  hwmon0/pwm1           current value: 13
  hwmon2/device/pwm1           current value: 77
hwmon2/device/pwm1 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm1_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm1.
  hwmon2/device/pwm2           current value: 86
hwmon2/device/pwm2 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm2_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm2.
  hwmon2/device/pwm3           current value: 102
hwmon2/device/pwm3 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm3_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm3.

Giving the fans some time to reach full speed...
Found the following fan sensors:
  hwmon2/device/fan1_input     current speed: 1362 RPM
  hwmon2/device/fan2_input     current speed: 953 RPM
  hwmon2/device/fan3_input     current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon0/pwm1 ...
 hwmon2/device/fan1_input ... speed was 1362 now 1390
   no correlation
 hwmon2/device/fan2_input ... speed was 953 now 953
   no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/pwm1,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? n

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.

由于 hwmon2/device/pwm1 设置为 2,我尝试将其编辑为 1 以手动控制 pwm。我尝试了以下命令:

cd /sys/class/hwmon/hwmon2/device/
echo 1 > pwm1_enable

但是,我收到以下错误:bash: echo: write error: Invalid argument

此外,我尝试更新驱动程序,但没有成功。

最后,我尝试更新控制风扇 RPM 的 BIOS 参数,但它似乎是只读的,而且 BIOS 太旧了,我不明白是否可以更改该值...

任何帮助都将不胜感激=)

使用以下方法提取计算机硬件sudo lshw:

description: Motherboard
product: 2AB6
vendor: PEGATRON CORPORATION
physical id: 0
version: 1.04
----------------------------
description: BIOS
vendor: AMI
physical id: 0
version: 7.14
date: 05/17/2011
size: 64KiB
capacity: 8MiB
capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification
----------------------------
description: CPU
product: Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
vendor: Intel Corp.
physical id: 4
bus info: cpu@0
version: 6.42.7
slot: CPU 1
size: 1742MHz
capacity: 3800MHz
width: 64 bits
clock: 100MHz
capabilities: lm fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp xsaveopt dtherm ida arat pln pts md_clear flush_l1d cpufreq
configuration: cores=4 enabledcores=1 microcode=47
----------------------------
description: System Memory
physical id: e
slot: System board or motherboard
size: 4GiB
----------------------------
(Comment if you need to know anything else)

sudo dmidecode -t bios

SMBIOS 2.6 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: AMI
    Version: 7.14
    Release Date: 05/17/2011
    Address: 0xF0000
    Runtime Size: 64 kB
    ROM Size: 8 MB
    Characteristics:
        PCI is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        Boot from CD is supported
        Selectable boot is supported
        BIOS ROM is socketed
        EDD is supported
        5.25"/1.2 MB floppy services are supported (int 13h)
        3.5"/720 kB floppy services are supported (int 13h)
        3.5"/2.88 MB floppy services are supported (int 13h)
        Print screen service is supported (int 5h)
        8042 keyboard services are supported (int 9h)
        Serial services are supported (int 14h)
        Printer services are supported (int 17h)
        ACPI is supported
        USB legacy is supported
        BIOS boot specification is supported
        Targeted content distribution is supported
    BIOS Revision: 7.14

Handle 0x0029, DMI type 13, 22 bytes
BIOS Language Information
    Language Description Format: Abbreviated
    Installable Languages: 12
        eng
        fra
        spa
        ger
        ita
        dan
        fin
        dut
        nor
        por
        swe
        jpn
    Currently Installed Language: fra
server
  • 1 个回答
  • 30 Views
Martin Hope
David Vitek
Asked: 2024-09-13 02:48:35 +0800 CST

在 ubuntu24 上使用 python 计数比在 ubunt18 上慢 6 倍

  • 10

从 ubuntu 18 升级到 ubuntu 24 时,我在运行 Python 解释器时遇到了性能倒退。您认为这是什么原因造成的?有修复或解决方法吗?

我有一些证据表明,Linux 内核的变化(而不是用户空间的任何变化)可能是造成该问题的原因。

我可以通过一个非常简单的测试重现性能差异:

python3 -c "import timeit; print(timeit.Timer('for _ in range(0,1000): pass').timeit())"

我通过在同一 Cisco UCS C220 M5SX 机架系统上启动 ubuntu 18 实时服务器和 ubuntu 24 实时服务器 ISO 来运行此测试。您可以在 Canonical 的网站上找到实时服务器 ISO 并重现实验。

我有一组在 Debian Squeeze 系统上从源代码构建的 Python 3.11 二进制文件,它们可以在各种 Linux 发行版上运行。这使我有机会在 18 和 24 上测试完全相同的 Python 二进制文件。我们将这些 Python 二进制文件称为 python_pegged。我们将通过“apt-get”获取的 Python3 称为 python_sys。

我也尝试在 ubuntu 24 中运行 ubuntu:18.04 docker 容器——它具有 ubuntu 24 的不良性能特征,并且行为不像 ubuntu 18,这让我相信用户空间不负责任。

实验结果:

Ubuntu 18.04.6 bare metal                            python_sys        13 seconds
Ubuntu 18.04.6 bare metal                            python_pegged     13 seconds
Ubuntu 18.04.6 bare metal                  sysbench --test=cpu run   1288 events/s
Ubuntu 24.04   bare metal                            python_sys        83 seconds
Ubuntu 24.04   bare metal                            python_pegged    112 seconds
Ubuntu 24.04   bare metal                  sysbench --test=cpu run    925 events/s
ubuntu:18.04 docker container hosted by Ubuntu 24.04 python_sys        82 seconds
ubuntu:18.04 docker container hosted by Ubuntu 24.04 python_pegged    112 seconds

在 ubuntu 24 中,采取以下操作没有任何效果:

  • 将 scaling_governor 设置为 performance
  • tuned-adm 配置文件吞吐量性能
  • tuned-adm 配置文件虚拟主机
  • tuned-adm 配置文件平衡

该系统有 40 个物理核心和 80 个超线程。我尝试运行各种数量的并发实例。

concurrent instances      seconds
                  40       82..83
                  80       53..53
                 120      87..115

我很惊讶 80 个实例比 40 个实例更快。我进行了几次实验,结果从未改变。我尝试了不同的调整配置文件,但没有效果。53 秒与 ubuntu18 的 13 秒相差甚远。

python 在 ubuntu24 上遇到了一些昂贵的问题,而 sysbench 不会,或者至少程度不同。我可能会在不久的将来开始使用分析器进行深入挖掘。

对各种中间版本的测试表明,在 21 -> 22 升级过程中出现了回归。

perf stat -a 在 python3 命令上的结果:

统计 Ubuntu 20 Ubuntu 22
CPU 时钟 80% 80%
上下文切换 0.003 开尔文/秒(3829) 6.656 / 秒 (45238)
CPU 迁移 0 公里/秒 (3) 0.039 / 秒 (268)
页面错误 0.001 开尔文/秒 (620) 0.151 / 秒 (1029)
周期 0.047 GHz 0.034 GHz
指示 3.34 指令/周期 0.88 insn/周期
分支 30.703 米/秒 5.329 米/秒
分支未命中 0.03% 13.18%

那里有很大的不同。我不相信每秒 6 次上下文切换真的能产生影响。每周期指令数大概是这里最相关的数据点。

kernel
  • 1 个回答
  • 187 Views
Martin Hope
Niru
Asked: 2024-09-13 01:11:20 +0800 CST

内核升级破坏自动解锁 - Cryptsetup

  • 5

内核版本更新导致自动解锁中断。我已将 Ubuntu 22.04 机器配置为每周自动更新,无需人工干预即可升级。在较新的内核更新中,例如:

│ Newer kernel available
│ 
│ The currently running kernel version is 5.15.0-118-generic which is not the expected kernel version 5.15.0-119-generic.
│                                                                                                                                                        
│ Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting.

自动解锁不起作用。问题似乎是内核更新强制重新启动以应用更新,但如果不手动输入磁盘加密密码则无法完成。重新启动后,我必须先运行以下命令重置磁盘加密: sudo clevis luks unbind -d <partition> -s <SLOT_NUMBER>然后运行以下命令重置加密设置: clevis luks bind -d <partition> tpm2 { "pcr_bank":"sha256", "pcr_ids": "<pcr_ids>" }'和。在重新启动之前update-initramfs -u -k 'all'是否使用生成启动映像似乎并不重要。如果我运行,我可以看到输出是正确的。搜索此问题没有找到任何结果。是否有任何配置是我遗漏的或我可以添加的任何配置?update-initramfsclevis luks list -d <partition>

  1. 在 Ubuntu 22.04 上设置磁盘加密并自动解锁。
  2. 运行sudo apt update并sudo apt upgrade触发内核版本更新。
  3. 重启
  4. 在启动盘上请求加密密码。

安装的软件包:

clevis
clevis-luks
clevis-initramfs
clevis-systemd
clevis-tpm
luks
  • 1 个回答
  • 50 Views
Martin Hope
Daniyal Lukmanov
Asked: 2024-09-12 17:53:56 +0800 CST

从 22.04 升级到 24.04LTS,网络完全不工作

  • 6

我无法使用有线连接或 USB 调制解调器(台式电脑,无 wifi)连接到互联网。检查 NetworkManager 的状态 - 它工作正常。但互联网仍然不可用。尝试了不同的方法 - 添加接口、使用 netplan 和其他 - 都没有帮助。我该怎么办?

在此处输入图片描述

在此处输入图片描述

networking
  • 2 个回答
  • 91 Views
Martin Hope
sanjihan
Asked: 2024-09-12 17:47:30 +0800 CST

通过 ssh 和不同的操作系统将文件内容复制到剪贴板

  • 7

我通过 ssh 连接到远程 ubuntu,并尝试将 ubuntu 24.04 机器上的文件内容 cat 到我的 MacOS 上的剪贴板中。

在我的本地 OSX 机器上,我通过 ssh 进入服务器并执行:

cat /usr/share/doc/apache2/README.Debian | xclip -selection clipboard

这会导致错误:Can't open display: (null)

我尝试使用-X标志进行 ssh,但出现同样的问题。

我可以使用 stfp 复制文件,但最好使用剪贴板。xclip可以跨操作系统复制剪贴板吗?

ssh
  • 1 个回答
  • 149 Views
Martin Hope
wzbillings
Asked: 2024-09-12 09:48:09 +0800 CST

为什么我的空文件没有被分配正确的 mimetype?

  • 15

当然,我使用的是Racket语言,它在安装时捆绑了自己的 IDE(Dr Racket)。我已成功将其安装在我的 Ubuntu 22.04 机器上。

但是,安装程序不会为文件创建 mimetype .rkt(IDE 使用的 Racket 代码文件的默认扩展名)。我希望.rkt单击文件时文件会在 Racket IDE 中打开,因此我创建了一个名为 的自定义 mimetype,text/rkt它运行良好。自定义图标可以正常工作,当我双击文件时,它们会在 Racket IDE 中打开。在我已经创建的代码文件中,自定义 mimetype 似乎可以正常工作。

但是,如果我touch test.rkt创建一个新文件,该文件会被分配 mimetype text/plain,当我双击它时,它会打开文本编辑器而不是 Racket IDE。这并不理想,因为我希望能够从终端创建空文件并在 IDE 中打开它们(这比每次在 IDE 中执行另存为 -> 随便什么都方便)。

是否可以将带有扩展名的空文件*.rkt识别为我的自定义 mimetype,而不是纯文本?

如果我做错了什么,下面是我的自定义 MIME 类型的代码:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
        <mime-type type="text/rkt">
                <comment>Racket code file</comment>
                <glob pattern="*.rkt"/>
        </mime-type>
</mime-info>

我按照这里的Ubuntu 文档操作,我发现它最后一次编辑是在 2014 年,还有一篇更新的帖子,但可能从那时起发生了一些变化。我是 Linux 新手,所以也许我不知道在哪里可以找到正确的说明。

mime-type
  • 1 个回答
  • 476 Views
Martin Hope
richey
Asked: 2024-09-12 07:50:27 +0800 CST

如何在 Ubuntu 中启用小米 Redmi Book 14 Pro 的声音?

  • 4

我在我的新小米 Redmi Book 14 Pro 笔记本上全新安装了上述 Ubuntu 24.04,但没有声音。在声音配置/设备中,我只看到“虚拟输出”作为设备。

我按照各种手册中描述的方法做了,比如

sudo alsa force-reload
sudo modprobe snd-hda-intel
apt-install --reinstall pulseaudio

以及apt remove --purge alsa-base随后apt install alsa-base

我的处理器是Intel® Core™ Ultra 7 Processor 155H

我的声卡是英特尔(显卡:Iris Xe Graphics)

pulseaudio
  • 1 个回答
  • 46 Views
Martin Hope
snnipetr
Asked: 2024-09-12 02:13:06 +0800 CST

可以删除 initrd.img-6.5.0-44-generic 而不产生任何后果吗?

  • 5

我目前正在运行 ubuntu 22.04,/boot 大小为 524Mb,剩余 296Mb。我已经删除了旧的配置和内核,但这个 initrd.img-6.5.0-44-generic 文件似乎占用了很多空间:

total 165260
-rw-r--r-- 1 root root    281081 Jun  7 18:29 config-6.5.0-44-generic
drwxr-xr-x 4 root root      4096 Jan  1  1970 efi
drwxr-xr-x 5 root root      4096 Sep 11 23:23 grub
lrwxrwxrwx 1 root root        27 Sep  5 23:54 initrd.img -> initrd.img-6.5.0-44-generic
-rw-r--r-- 1 root root 145793563 Sep  6 11:37 initrd.img-6.5.0-44-generic
lrwxrwxrwx 1 root root        27 Sep 11 23:23 initrd.img.old -> initrd.img-6.5.0-44-generic
drwx------ 2 root root     16384 Jan 31  2024 lost+found
-rw-r--r-- 1 root root    148440 Aug 19  2023 memtest86+x64.bin
-rw-r--r-- 1 root root    149504 Aug 19  2023 memtest86+x64.efi
-rw------- 1 root root   8527335 Jun  7 18:29 System.map-6.5.0-44-generic
lrwxrwxrwx 1 root root        24 Sep  5 23:54 vmlinuz -> vmlinuz-6.5.0-44-generic
-rw------- 1 root root  14304328 Jun  7 19:09 vmlinuz-6.5.0-44-generic
lrwxrwxrwx 1 root root        24 Sep 11 23:23 vmlinuz.old -> vmlinuz-6.5.0-44-generic
snnipetr@mahoraga:~$

删除此文件安全吗?另外,它的用途是什么?谢谢。

编辑:添加了输出lsblk

snnipetr@mahoraga:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0          7:0    0     4K  1 loop /snap/bare/5
loop1          7:1    0 173.5M  1 loop /snap/brave/436
loop2          7:2    0   173M  1 loop /snap/brave/438
loop3          7:3    0 167.6M  1 loop /snap/chromium/2943
loop4          7:4    0 313.7M  1 loop /snap/code/168
loop5          7:5    0  63.9M  1 loop /snap/core20/2318
loop6          7:6    0  74.3M  1 loop /snap/core22/1586
loop7          7:7    0  74.3M  1 loop /snap/core22/1612
loop8          7:8    0  67.8M  1 loop /snap/cups/1058
loop9          7:9    0 240.5M  1 loop /snap/firefox/3216
loop10         7:10   0 271.2M  1 loop /snap/firefox/4848
loop11         7:11   0  10.7M  1 loop /snap/firmware-updater/121
loop12         7:12   0  10.7M  1 loop /snap/firmware-updater/127
loop13         7:13   0   7.4M  1 loop /snap/gedit/684
loop14         7:14   0   497M  1 loop /snap/gnome-42-2204/141
loop15         7:15   0 505.1M  1 loop /snap/gnome-42-2204/176
loop16         7:16   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop17         7:17   0  10.2M  1 loop /snap/snap-store/1106
loop18         7:18   0  10.5M  1 loop /snap/snap-store/1173
loop19         7:19   0  40.4M  1 loop /snap/snapd/20671
loop20         7:20   0  38.8M  1 loop /snap/snapd/21759
loop21         7:21   0   452K  1 loop /snap/snapd-desktop-integration/83
loop22         7:22   0   139M  1 loop 
sda            8:0    0 931.5G  0 disk 
├─sda1         8:1    0   260M  0 part 
├─sda2         8:2    0    16M  0 part 
├─sda3         8:3    0   123G  0 part 
├─sda4         8:4    0   631M  0 part 
├─sda5         8:5    0 390.9G  0 part 
└─sda6         8:6    0 416.7G  0 part 
sdb            8:16   0 931.5G  0 disk 
└─sdb1         8:17   0 931.5G  0 part /media/snnipetr/T7
nvme0n1      259:0    0 953.9G  0 disk 
├─nvme0n1p1  259:1    0   260M  0 part /boot/efi
├─nvme0n1p2  259:2    0    16M  0 part 
├─nvme0n1p3  259:3    0   200G  0 part 
├─nvme0n1p4  259:4    0 652.6G  0 part 
├─nvme0n1p5  259:5    0    30G  0 part /var/snap/firefox/common/host-hunspell
│                                      /
├─nvme0n1p6  259:6    0     1G  0 part 
├─nvme0n1p7  259:7    0    20G  0 part /home
├─nvme0n1p8  259:8    0    20G  0 part /var
├─nvme0n1p9  259:9    0    20G  0 part /tmp
├─nvme0n1p10 259:10   0   500M  0 part /boot
└─nvme0n1p11 259:11   0   9.5G  0 part /usr/local
boot
  • 1 个回答
  • 30 Views
Martin Hope
Pansmanser
Asked: 2024-09-11 23:38:18 +0800 CST

如何在 Ubuntu 中重新映射 Windows 副驾驶键?

  • 5

在此处输入图片描述我有一台戴尔笔记本电脑(inspiron 16 5645)。除了 Super 键之外,它还有另一个键,据说是 Windows 副驾驶键。它似乎表现得像左移键,xev 将其报告为相同的键码,但大概 Windows 可以区分它。

我可以用它做点有用的事情吗?我想将它映射到右 ctrl,但它不存在。

编辑:添加终端输出:-外窗口为 0x800001,内窗口为 0x800002

PropertyNotify event, serial 8, synthetic NO, window 0x800001,
    atom 0x27 (WM_NAME), time 74036986, state PropertyNewValue
PropertyNotify event, serial 9, synthetic NO, window 0x800001,
    atom 0x22 (WM_COMMAND), time 74036986, state PropertyNewValue
PropertyNotify event, serial 10, synthetic NO, window 0x800001,
    atom 0x28 (WM_NORMAL_HINTS), time 74036986, state PropertyNewValue
CreateNotify event, serial 11, synthetic NO, window 0x800001,
    parent 0x800001, window 0x800002, (10,10), width 50, height 50
border_width 4, override NO
PropertyNotify event, serial 14, synthetic NO, window 0x800001,
    atom 0xf9 (WM_PROTOCOLS), time 74036986, state PropertyNewValue
MapNotify event, serial 15, synthetic NO, window 0x800001,
    event 0x800001, window 0x800002, override NO
ConfigureNotify event, serial 21, synthetic NO, window 0x800001,
    event 0x800001, window 0x800001, (0,0), width 178, height 178,
    border_width 0, above 0x600109, override NO
PropertyNotify event, serial 28, synthetic NO, window 0x800001,
    atom 0x16f (_NET_WM_ALLOWED_ACTIONS), time 74036986, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0x800001,
    atom 0x153 (_MUTTER_NEEDS_FRAME), time 74036986, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0x800001,
    atom 0x101 (_NET_WM_DESKTOP), time 74036986, state PropertyNewValue
PropertyNotify event, serial 31, synthetic NO, window 0x800001,
    atom 0x13b (WM_STATE), time 74036987, state PropertyNewValue
PropertyNotify event, serial 31, synthetic NO, window 0x800001,
    atom 0x107 (_NET_WM_STATE), time 74036987, state PropertyNewValue
PropertyNotify event, serial 31, synthetic NO, window 0x800001,
    atom 0x131 (_GTK_EDGE_CONSTRAINTS), time 74036987, state PropertyNewValue
ConfigureNotify event, serial 34, synthetic NO, window 0x800001,
    event 0x800001, window 0x800001, (50,32), width 178, height 178,
    border_width 0, above 0x600109, override NO
PropertyNotify event, serial 34, synthetic NO, window 0x800001,
    atom 0x131 (_GTK_EDGE_CONSTRAINTS), time 74036988, state PropertyNewValue
ReparentNotify event, serial 34, synthetic NO, window 0x800001,
    event 0x800001, window 0x800001, parent 0xa001a0,
    (0,0), override NO
PropertyNotify event, serial 34, synthetic NO, window 0x800001,
    atom 0xfe (_NET_FRAME_EXTENTS), time 74037001, state PropertyNewValue
ConfigureNotify event, serial 34, synthetic NO, window 0x800001,
    event 0x800001, window 0x800001, (14,49), width 178, height 178,
    border_width 0, above 0xa001a1, override NO
MapNotify event, serial 35, synthetic NO, window 0x800001,
    event 0x800001, window 0x800001, override NO
VisibilityNotify event, serial 35, synthetic NO, window 0x800001,
    state VisibilityUnobscured
Expose event, serial 35, synthetic NO, window 0x800001,
    (0,0), width 178, height 10, count 3
Expose event, serial 35, synthetic NO, window 0x800001,
    (0,10), width 10, height 58, count 2
Expose event, serial 35, synthetic NO, window 0x800001,
    (68,10), width 110, height 58, count 1
Expose event, serial 35, synthetic NO, window 0x800001,
    (0,68), width 178, height 110, count 0
ConfigureNotify event, serial 35, synthetic YES, window 0x800001,
    event 0x800001, window 0x800001, (198,217), width 178, height 178,
    border_width 2, above 0x0, override NO
PropertyNotify event, serial 35, synthetic NO, window 0x800001,
    atom 0x107 (_NET_WM_STATE), time 74037002, state PropertyNewValue
FocusIn event, serial 35, synthetic NO, window 0x800001,
    mode NotifyNormal, detail NotifyNonlinear
KeymapNotify event, serial 35, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
PropertyNotify event, serial 35, synthetic NO, window 0x800001,
    atom 0x107 (_NET_WM_STATE), time 74037005, state PropertyNewValue
PropertyNotify event, serial 35, synthetic NO, window 0x800001,
    atom 0x107 (_NET_WM_STATE), time 74037005, state PropertyNewValue
EnterNotify event, serial 35, synthetic NO, window 0x800001,
    root 0x3d1, subw 0x0, time 74037005, (155,114), root:(355,333),
    mode NotifyNormal, detail NotifyNonlinear, same_screen YES,
    focus YES, state 0
KeymapNotify event, serial 35, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
PropertyNotify event, serial 35, synthetic NO, window 0x800001,
    atom 0x107 (_NET_WM_STATE), time 74037016, state PropertyNewValue
KeyRelease event, serial 35, synthetic NO, window 0x800001,
    root 0x3d1, subw 0x0, time 74037112, (155,114), root:(355,333),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
    XLookupString gives 1 bytes: (0d) "
"
    XFilterEvent returns: False
KeyPress event, serial 38, synthetic NO, window 0x800001,
    root 0x3d1, subw 0x0, time 74043466, (155,114), root:(355,333),
    state 0x40, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x800001,
    root 0x3d1, subw 0x0, time 74043594, (155,114), root:(355,333),
    state 0x41, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
LeaveNotify event, serial 38, synthetic NO, window 0x800001,
    root 0x3d1, subw 0x0, time 74047709, (-12,-47), root:(188,172),
    mode NotifyNormal, detail NotifyAncestor, same_screen YES,
    focus YES, state 0
ClientMessage event, serial 38, synthetic YES, window 0x800001,
    message_type 0xf9 (WM_PROTOCOLS), format 32, message 0xf7 (WM_DELETE_WINDOW)
keyboard
  • 2 个回答
  • 300 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