Твики Кали - шорткаты клавы

Discussion in 'Linux, Freebsd, *nix' started by ckpunmkug, 16 Jun 2019.

  1. ckpunmkug

    ckpunmkug Member

    Joined:
    20 Mar 2017
    Messages:
    53
    Likes Received:
    35
    Reputations:
    2
    В xfce4 можно на нажатие кнопок навесить запуск программ. Menu -> Settings -> Keyboard -> Application Shortcuts

    Alt+Esc - список открытых окон (работает только xfce4)
    Code:
    /usr/bin/xfdesktop --windowlist

    Ctrl+Delete - очистка буфера обмена (clipboard)
    Code:
    /usr/local/bin/clear_clipboard
    /usr/local/bin/clear_clipboard
    Code:
    /usr/bin/xsel -c -b

    PrtScr - сделать скриншот
    Code:
    /usr/bin/xfce4-screenshooter -s /home/user/Pictures/Screenshots -f

    Win+ScrollLock - выключить монитор
    Code:
    /usr/local/bin/monitor_off
    /usr/local/bin/monitor_off
    Code:
    sleep 1; xset dpms force off

    Регулирование громкости
    Win+Up
    Code:
    /usr/local/bin/volume +
    Win+Down
    Code:
    /usr/local/bin/volume -
    /usr/local/bin/volume
    Code:
    #!/usr/bin/php
    <?php
    $command = "pactl list sinks";
    $output = [];
    $return = 0;
    exec($command, $output, $return);
    if ($return != 0) {
    	trigger_error("pactl can't list sinks", E_USER_WARNING);
    	exit(255); 
    }
    $volume = null;
    foreach ($output as $string) {
    	if (preg_match("/^\s+Volume:\s+.+\s+([0-9]+)\%\s+.+$/", $string, $matches) == 1) {
    		//echo $matches[1][email protected]$argv[1].$string."\n";
    		$volume = intval($matches[1]);
    	}
    }
    if ($volume == null) {
    	trigger_error("volume value not found", E_USER_WARNING);
    	exit(255); 
    }
    if (@$argv[1] == '+') {
    	$volume += 5;
    	if ($volume > 100)
    		$volume = 100;
    	
    }
    if (@$argv[1] == '-') {
    	$volume -= 5;
    	if ($volume < 0)
    		$volume = 0;
    	
    }
    system("pactl set-sink-volume 0 {$volume}%");

    Эмуляция мышиного скрола
    Win+PageUp
    Code:
    xdotool click 4
    Win+PageDown
    Code:
    xdotool click 5

    Подкрутим xfce4-terminal
    ~/.config/xfce4/terminal/accels.scm
    Code:
    (gtk_accel_path "<Actions>/terminal-window/paste" "<Primary><Shift>Insert")
    (gtk_accel_path "<Actions>/terminal-window/copy" "<Primary>Insert")
    Ещё в Terminal Preferences -> Advanced снять галку с Automatically copy selection to clipboard
    Сразу становится удобней копировать и вставлять. Я лично забыл про комбы Ctrl+C Ctrl+V
     
    #1 ckpunmkug, 16 Jun 2019
    Last edited: 16 Jun 2019
    mail156 likes this.
Loading...