LINUX.ORG.RU

Сообщения iskander9908

 

Показ экрана в zoom

Форум — Desktop

У меня не работает показ экрана в zoom. Вот мои конфиги:

cat ~/.zshenv
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_TYPE=wayland
export USER=iskander

cat ~/.config/zoomus.conf
[General]
...
enableWaylandShare=true
xwayland=true
...
pacman -Ss xdg-desktop-portal
extra/xdg-desktop-portal 1.18.4-1 [installed]
    Desktop integration portals for sandboxed apps
extra/xdg-desktop-portal-dde 1.0.5-5 (deepin)
    A backend implementation for xdg-desktop-portal on Deepin desktop environment
extra/xdg-desktop-portal-gnome 46.2-2 (gnome)
    A backend implementation for xdg-desktop-portal for the GNOME desktop environment
extra/xdg-desktop-portal-gtk 1.15.1-2 [installed]
    A backend implementation for xdg-desktop-portal using GTK
extra/xdg-desktop-portal-hyprland 1.3.2-1
    xdg-desktop-portal backend for hyprland
extra/xdg-desktop-portal-kde 6.1.2-1 (plasma)
    A backend implementation for xdg-desktop-portal using Qt/KF5
extra/xdg-desktop-portal-lxqt 1.0.2-1 (lxqt)
    A backend implementation for xdg-desktop-portal using Qt/KDE Frameworks/libfm-qt
extra/xdg-desktop-portal-wlr 0.7.0-2 [installed]
    xdg-desktop-portal backend for wlroots
extra/xdg-desktop-portal-xapp 1.0.7-1
    A backend implementation for xdg-desktop-portal using GTK and various pieces of Cinnamon/MATE/Xfce4 infrastructure

Перемещено hobbit из general

 , ,

iskander9908
()

Pipewire

Форум — Admin

Недавно решил поковыряться в wireplumber и сломал его. Теперь не работает звук. Хотел разобраться в логах, но теперь я ещё в большем недоумении.

journalctl --user -u wireplumber -f                                                                                                                                                    1 ↵
Jun 30 17:00:30 arch systemd[1411]: Started Multimedia Service Session Manager.
Jun 30 17:00:31 arch wireplumber[1771]: wp-device: SPA handle 'api.alsa.acp.device' could not be loaded; is it installed?
Jun 30 17:00:31 arch wireplumber[1771]: s-monitors: Failed to create 'api.alsa.acp.device' device
Jun 30 17:00:31 arch wireplumber[1771]: spa.alsa: Path Mic ACP LED is not a volume or mute control
Jun 30 17:00:31 arch wireplumber[1771]: default: Failed to get percentage from UPower: org.freedesktop.DBus.Error.NameHasNoOwner
Jun 30 17:00:31 arch wireplumber[1771]: spa.bluez5: BlueZ system service is not available
Jun 30 17:00:31 arch wireplumber[1771]: wp-event-dispatcher: <WpAsyncEventHook:0x5d05f1e54e40> failed: failed to activate item: Object activation aborted: proxy destroyed
Jun 30 17:00:31 arch wireplumber[1771]: [0:00:34.370908442] [1771] ERROR IPAModule ipa_module.cpp:172 Symbol ipaModuleInfo not found
Jun 30 17:00:31 arch wireplumber[1771]: [0:00:34.370918988] [1771] ERROR IPAModule ipa_module.cpp:292 v4l2-compat.so: IPA module has no valid info
Jun 30 17:00:31 arch wireplumber[1771]: [0:00:34.370945179] [1771]  INFO Camera camera_manager.cpp:313 libcamera v0.3.0

 , ,

iskander9908
()

OBS в sway

Форум — Desktop

Не могу сделать запись экран через OBS на arch linux со sway. Пакеты wireplumber и xdg-desktop-portal-wlr установил, но во время записи горит чёрный экран.

 , ,

iskander9908
()

Wireguard

Форум — Admin

Хочу настроить wireguard для Ubuntu сервера и Arch Linux клиента. Поэтому интересуюсь, подойдёт ли инструкция на digital ocean? А то в archwiki немного подругому.
P.S - Возможно, это глупый вопрос, но я в теории сетей не разбираюь. Поэтому объясните по подробней, пожалуйста.

 , ,

iskander9908
()

qutebrowser

Форум — General

Хотел настроить автологин в qutebrowser. Для этого я установил пакеты pass и wofi (уже был в системе), импортировал скрипт в

/usr/share/qutebrowser/userscripts/qute-pass
изменив при этом rofi на wofi:
sudo nvim /usr/share/qutebrowser/userscripts/qute-pass
#!/usr/bin/env python3

# SPDX-FileCopyrightText: Chris Braun (cryzed) <cryzed@googlemail.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Insert login information using pass and a dmenu-compatible application (e.g. dmenu, rofi -dmenu, ...). A short
demonstration can be seen here: https://i.imgur.com/KN3XuZP.gif.
"""

USAGE = """The domain of the site has to appear as a segment in the pass path,
for example: "github.com/cryzed" or "websites/github.com". Alternatively the
parameter `--unfiltered` may be used to get a list of all passwords. How the
username and password are determined is freely configurable using the CLI
arguments. As an example, if you instead store the username as part of the
secret (and use a site's name as filename), instead of the default configuration,
use `--username-target secret` and `--username-pattern "username: (.+)"`.

The login information is inserted by emulating key events using qutebrowser's
fake-key command in this manner: [USERNAME]<Tab>[PASSWORD], which is compatible
with almost all login forms.

If you use gopass with multiple mounts, use the CLI switch --mode gopass to switch to gopass mode.

Suggested bindings similar to Uzbl's `formfiller` script:

    config.bind('<z><l>', 'spawn --userscript qute-pass')
    config.bind('<z><u><l>', 'spawn --userscript qute-pass --username-only')
    config.bind('<z><p><l>', 'spawn --userscript qute-pass --password-only')
    config.bind('<z><o><l>', 'spawn --userscript qute-pass --otp-only')
"""

EPILOG = """Dependencies: tldextract (Python 3 module), pass, pass-otp (optional).

WARNING: The login details are viewable as plaintext in qutebrowser's debug log (qute://log) and might be shared if
you decide to submit a crash report!"""

import argparse
import enum
import fnmatch
import functools
import os
import re
import shlex
import subprocess
import sys
from urllib.parse import urlparse

import tldextract


def expanded_path(path):
    # Expand potential ~ in paths, since this script won't be called from a shell that does it for us
    expanded = os.path.expanduser(path)
    # Add trailing slash if not present
    return os.path.join(expanded, '')


argument_parser = argparse.ArgumentParser(description=__doc__, usage=USAGE, epilog=EPILOG)
argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL'))
argument_parser.add_argument('--password-store', '-p',
                             default=expanded_path(os.getenv('PASSWORD_STORE_DIR', default='~/.password-store')),
                             help='Path to your pass password-store (only used in pass-mode)', type=expanded_path)
argument_parser.add_argument('--mode', '-M', choices=['pass', 'gopass'], default="pass",
                             help='Select mode [gopass] to use gopass instead of the standard pass.')
argument_parser.add_argument('--prefix', type=str,
                             help='Search only the given subfolder of the store (only used in gopass-mode)')
argument_parser.add_argument('--username-pattern', '-u', default=r'.*/(.+)',
                             help='Regular expression that matches the username')
argument_parser.add_argument('--username-target', '-U', choices=['path', 'secret'], default='path',
                             help='The target for the username regular expression')
argument_parser.add_argument('--password-pattern', '-P', default=r'(.*)',
                             help='Regular expression that matches the password')
argument_parser.add_argument('--dmenu-invocation', '-d', default='wofi -dmenu',
                             help='Invocation used to execute a dmenu-provider')
argument_parser.add_argument('--no-insert-mode', '-n', dest='insert_mode', action='store_false',
                             help="Don't automatically enter insert mode")
argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
                             help='Encoding used to communicate with subprocesses')
argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
                             help='Merge pass candidates for fully-qualified and registered domain name')
argument_parser.add_argument('--extra-url-suffixes', '-s', default='',
                             help='Comma-separated string containing extra suffixes (e.g local)')
argument_parser.add_argument('--unfiltered', dest='unfiltered', action='store_true',
                             help='Show an unfiltered selection of all passwords in the store')
argument_parser.add_argument('--always-show-selection', dest='always_show_selection', action='store_true',
                             help='Always show selection, even if there is only a single match')
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e', action='store_true', help='Only insert username')
group.add_argument('--password-only', '-w', action='store_true', help='Only insert password')
group.add_argument('--otp-only', '-o', action='store_true', help='Only insert OTP code')

stderr = functools.partial(print, file=sys.stderr)


class ExitCodes(enum.IntEnum):
    SUCCESS = 0
    FAILURE = 1
    # 1 is automatically used if Python throws an exception
    NO_PASS_CANDIDATES = 2
    COULD_NOT_MATCH_USERNAME = 3
    COULD_NOT_MATCH_PASSWORD = 4


class CouldNotMatchUsername(Exception):
    pass


class CouldNotMatchPassword(Exception):
    pass


def qute_command(command):
    with open(os.environ['QUTE_FIFO'], 'w') as fifo:
        fifo.write(command + '\n')
        fifo.flush()


def find_pass_candidates(domain, unfiltered=False):
    candidates = []

    if arguments.mode == "gopass":
        gopass_args = ["gopass", "list", "--flat"]
        if arguments.prefix:
            gopass_args.append(arguments.prefix)
        all_passwords = subprocess.run(gopass_args, stdout=subprocess.PIPE).stdout.decode("UTF-8").splitlines()

        for password in all_passwords:
            if unfiltered or domain in password:
                candidates.append(password)
    else:
        for path, directories, file_names in os.walk(arguments.password_store, followlinks=True):
            secrets = fnmatch.filter(file_names, '*.gpg')
            if not secrets:
                continue

            # Strip password store path prefix to get the relative pass path
            pass_path = path[len(arguments.password_store):]
            split_path = pass_path.split(os.path.sep)
            for secret in secrets:
                secret_base = os.path.splitext(secret)[0]
                if not unfiltered and domain not in (split_path + [secret_base]):
                    continue

                candidates.append(os.path.join(pass_path, secret_base))
    return candidates


def _run_pass(pass_arguments):
    # The executable is conveniently named after it's mode [pass|gopass].
    pass_command = [arguments.mode]
    env = os.environ.copy()
    env['PASSWORD_STORE_DIR'] = arguments.password_store
    process = subprocess.run(pass_command + pass_arguments, env=env, stdout=subprocess.PIPE)
    return process.stdout.decode(arguments.io_encoding).strip()


def pass_(path):
    return _run_pass(['show', path])


def pass_otp(path):
    if arguments.mode == "gopass":
        return _run_pass(['otp', '-o', path])
    return _run_pass(['otp', path])


def dmenu(items, invocation):
    command = shlex.split(invocation)
    process = subprocess.run(command, input='\n'.join(items).encode(arguments.io_encoding), stdout=subprocess.PIPE)
    return process.stdout.decode(arguments.io_encoding).strip()


def fake_key_raw(text):
    for character in text:
        # Escape all characters by default, space requires special handling
        sequence = '" "' if character == ' ' else r'\{}'.format(character)
        qute_command('fake-key {}'.format(sequence))


def extract_password(secret, pattern):
    match = re.match(pattern, secret)
    if not match:
        raise CouldNotMatchPassword("Pattern did not match target")
    try:
        return match.group(1)
    except IndexError:
        raise CouldNotMatchPassword("Pattern did not contain capture group, please use capture group. Example: (.*)")


def extract_username(target, pattern):
    match = re.search(pattern, target, re.MULTILINE)
    if not match:
        raise CouldNotMatchUsername("Pattern did not match target")
    try:
        return match.group(1)
    except IndexError:
        raise CouldNotMatchUsername("Pattern did not contain capture group, please use capture group. Example: (.*)")


def main(arguments):
    if not arguments.url:
        argument_parser.print_help()
        return ExitCodes.FAILURE

    extractor = tldextract.TLDExtract(extra_suffixes=arguments.extra_url_suffixes.split(','))
    extract_result = extractor(arguments.url)

    # Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
    # the registered domain name, the IPv4 address if that's what the URL represents and finally the private domain
    # (if a non-public suffix was used), and the URL netloc.
    candidates = set()
    attempted_targets = []

    private_domain = ''
    if not extract_result.suffix:
        private_domain = ('.'.join((extract_result.subdomain, extract_result.domain))
                          if extract_result.subdomain else extract_result.domain)

    netloc = urlparse(arguments.url).netloc

    for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4, private_domain, netloc]):
        attempted_targets.append(target)
        target_candidates = find_pass_candidates(target, unfiltered=arguments.unfiltered)
        if not target_candidates:
            continue

        candidates.update(target_candidates)
        if not arguments.merge_candidates:
            break
    else:
        if not candidates:
            stderr('No pass candidates for URL {!r} found! (I tried {!r})'.format(arguments.url, attempted_targets))
            return ExitCodes.NO_PASS_CANDIDATES

    if len(candidates) == 1 and not arguments.always_show_selection:
        selection = candidates.pop()
    else:
        selection = dmenu(sorted(candidates), arguments.dmenu_invocation)

    # Nothing was selected, simply return
    if not selection:
        return ExitCodes.SUCCESS

    # If username-target is path and user asked for username-only, we don't need to run pass.
    # Or if using otp-only, it will run pass on its own.
    secret = None
    if not (arguments.username_target == 'path' and arguments.username_only) and not arguments.otp_only:
        secret = pass_(selection)
    username_target = selection if arguments.username_target == 'path' else secret
    try:
        if arguments.username_only:
            fake_key_raw(extract_username(username_target, arguments.username_pattern))
        elif arguments.password_only:
            fake_key_raw(extract_password(secret, arguments.password_pattern))
        elif arguments.otp_only:
            otp = pass_otp(selection)
            fake_key_raw(otp)
        else:
            # Enter username and password using fake-key and <Tab> (which seems to work almost universally), then switch
            # back into insert-mode, so the form can be directly submitted by hitting enter afterwards
            fake_key_raw(extract_username(username_target, arguments.username_pattern))
            qute_command('fake-key <Tab>')
            fake_key_raw(extract_password(secret, arguments.password_pattern))
    except CouldNotMatchPassword as e:
        stderr('Failed to match password, target: secret, error: {}'.format(e))
        return ExitCodes.COULD_NOT_MATCH_PASSWORD
    except CouldNotMatchUsername as e:
        stderr('Failed to match username, target: {}, error: {}'.format(arguments.username_target, e))
        return ExitCodes.COULD_NOT_MATCH_USERNAME

    if arguments.insert_mode:
        qute_command('mode-enter insert')

    return ExitCodes.SUCCESS


if __name__ == '__main__':
    arguments = argument_parser.parse_args()
    sys.exit(main(arguments))
. Дал скрипту права на запуск, но запуская команду
:spawn --userscript qute-pass
, она возращает такую ошибку:
Process 4494: /usr/share/qutebrowser/userscripts/qute-pass
Info
Command    
/usr/share/qutebrowser/userscripts/qute-pass
Status    Userscript exited with status 2.
Standard output
No output.
Standard error
No pass candidates for URL 'qute://settings/' found! (I tried ['settings', 'settings'])

 , , ,

iskander9908
()

Настройка яркости

Форум — Desktop

Хочу настроить яркость клавиатуры на ноутбуке, но не вижу клавиатуру в списке.

ls /sys/class/leds/                                                                                                                                                                   
input37::capslock  input37::compose  input37::kana  input37::numlock  input37::scrolllock  input4::capslock  input4::numlock  input4::scrolllock
.

 , ,

iskander9908
()

Лагают игры

Форум — Games

Всем привет! У меня лагают игры когда ноутбук не на зарядке. Я думал это из-за tlp, но когда его отключил, игры всё равно лагали. Вроде все драйвера есть, но играть невозможно.

 , ,

iskander9908
()

systemd

Форум — Admin

Хотел настроить systemd для запуска уведомлений. Для этого я создал службу и таймер:

/etc/systemd/system/battery-notification.service
[Unit]
Description=Battery Notification Service

[Service]
ExecStart=/home/iskander/.local/bin/battery-notification.sh

[Install]
WantedBy=battery-notification.timer

[Unit]
Description=Battery Notification Timer

[Timer]
OnActiveSec=2min
OnUnitActiveSec=2min

[Install]
WantedBy=timers.target

. После перезапустил демоны

sudo systemctl daemon-reload
и запустил службу
sudo systemctl enable --now battery-notification.timer
, но уведомления не приходят

 , ,

iskander9908
()

Иконки для уведомлений

Форум — Desktop

Хочу использовать иконки для уведомлений в dunst, но отображается только текст

notify-send -u critical "Battery low" -i "battery-caution.svg"
, хотя иконка существует.
ls /usr/share/icons/Papirus/16x16/panel/ | grep "battery-caution.svg"                                                                                                                 
battery-caution.svg
keyboard-battery-caution.svg
mouse-battery-caution.svg
phone-battery-caution.svg
Вот мой dunst конфиг
### Icons ###
    ...
    # Recursive icon lookup. You can set a single theme, instead of having to
    # Set icon theme (only used for recursive icon lookup)
    icon_theme = Papirus
    # define all lookup paths.
    enable_recursive_icon_lookup = true
    # You can also set multiple icon themes, with the leftmost one being used first.
    # icon_theme = "Adwaita, breeze"

    # Align icons left/right/top/off
    icon_position = left

    # Scale small icons up to this size, set to 0 to disable. Helpful
    # for e.g. small files or high-dpi screens. In case of conflict,
    # max_icon_size takes precedence over this.
    min_icon_size = 32

    # Scale larger icons down to this size, set to 0 to disable
    max_icon_size = 128

    # Paths to default icons (only neccesary when not using recursive icon lookup)
    icon_path = /usr/share/icons/Adwaita/16x16/devices/:/usr/share/icons/Papirus/16x16/panel/
    ### History ###

    # Should a notification popped up from history be sticky or timeout
    # as if it would normally do.
    sticky_history = yes

    # Maximum amount of notifications kept in history
    history_length = 20
    ...
.

 , ,

iskander9908
()

Arch

Форум — Talks

На моём ноуте стоит арч больше месяца. Всё делал по гайду и рекомендациям арч вики. Система работает шустро и без поломок, если даже что-то происходило, то по моей вине. Но истории о нестабильнолсти арча заставляют меня задуматься, стоит ли мне его использовать? Достачтно ли у меня сил, чтобы всё исправить? Ведь все мои знания о линуксе и об операционных систем взяты из вики и сомневаюсь хватит ли этого. Лучше ли начать с чего-то по-проще или я просто парюсь из-за пустяка?

Перемещено hobbit из general

 

iskander9908
()

bash скрипты

Форум — Admin

Всем привет! Недавно установил arch на свой ноутбук и потратил много времени над его настройкой. Чтобы сэконмить время в следуйщий раз - решил написать скрипт для её автоматизации. Можете посоветовать литературу для этого, желательно с задачами

 , ,

iskander9908
()

Fedora стала работать медленно

Форум — Linux-hardware

Здраствуйте! Недавно я установил Fedora 36 Workstation. Всё работало прекрасно, не было проблем с анимацией в GNOME и в целом система работала прексрасно. Но так как в Fedora по умолчанию стоят только свободные драйвера, для большего комфорта я решил установить проприетарные драйвера, чтобы увеличить продуктивность в играх. Но после установки система начала тормозить, появились проблемы с анимацией и на Wayland и на Xorg сессии.

lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Picasso/Raven 2 [Radeon Vega Series / Radeon Vega Mobile Series] (rev c2)

 , ,

iskander9908
()

RSS подписка на новые темы