Adding libinput and some various changes

This commit is contained in:
Chris Cochrun 2021-05-28 20:27:26 -05:00
parent f7c99edabb
commit ed47a44b2b
14 changed files with 248 additions and 14 deletions

View file

@ -72,7 +72,7 @@
(if (= "syl\n" stdout) (if (= "syl\n" stdout)
(global laptop true) (global laptop true)
(global laptop false)))) (global laptop false))))
(local laptop false) (local laptop true)
;; Table of layouts to cover with awful.layout.inc, order matters. ;; Table of layouts to cover with awful.layout.inc, order matters.
(set awful.layout.layouts [ (set awful.layout.layouts [

View file

@ -128,6 +128,8 @@
;; Programs ;; Programs
(awful.key [ modkey ] "d" (fn [] (awful.spawn "emacsclient -c -e '(dired-jump)'")) (awful.key [ modkey ] "d" (fn [] (awful.spawn "emacsclient -c -e '(dired-jump)'"))
{:description "launch dired in new emacs frame" :group "apps" }) {:description "launch dired in new emacs frame" :group "apps" })
(awful.key [ modkey shift ] "d" (fn [] (awful.spawn "dolphin"))
{:description "launch dolphin file browser" :group "apps" })
(awful.key [ modkey ] "x" (fn [] (awful.spawn "emacsclient -c -e '(org-capture)'")) (awful.key [ modkey ] "x" (fn [] (awful.spawn "emacsclient -c -e '(org-capture)'"))
{:description "launch scratchpad in new emacs frame" :group "apps" }) {:description "launch scratchpad in new emacs frame" :group "apps" })
(awful.key [ modkey ] "'" (fn [] (awful.spawn "emacsclient -e '(org-agenda-list)'" (awful.key [ modkey ] "'" (fn [] (awful.spawn "emacsclient -e '(org-agenda-list)'"

View file

@ -1 +1,8 @@
13/04/21 (10:07:06) | WARNING: No theme named "+nord" found! 13/04/21 (10:07:06) | WARNING: No theme named "+nord" found!
27/05/21 (09:39:49) | ERROR: Input thread failed with exception: (5, 'Input/output error')
Traceback (most recent call last):
File "/usr/bin/bpytop", line 983, in _get_key
input_key = ""
File "/usr/bin/bpytop", line 776, in __exit__
termios.tcsetattr(self.stream, termios.TCSANOW, self.original_stty)
termios.error: (5, 'Input/output error')

View file

@ -208,6 +208,6 @@ alias la "exa -la"
### Start X at login ### Start X at login
if status is-login if status is-login
if test -z "$DISPLAY" -a "$XDG_VTNR" = 1 if test -z "$DISPLAY" -a "$XDG_VTNR" = 1
exec startx -- -keeptty exec starx
end end
end end

View file

@ -50,6 +50,8 @@ s = scaling next
a = zoom actual a = zoom actual
r = reset r = reset
d = exec rm $imv_current_file
# Gif playback # Gif playback
<period> = next_frame <period> = next_frame
<space> = toggle_playing <space> = toggle_playing

197
libinput-gestures.conf Normal file
View file

@ -0,0 +1,197 @@
# Configuration file for libinput-gestures.
# Mark Blakeney, Sep 2015
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Lines starting with '#' and blank lines are ignored. Currently
# "gesture" and "device" configuration keywords are supported as
# described below. The keyword can optionally be appended with a ":" (to
# maintain compatibility with original format configuration files).
#
# Each gesture line has 3 [or 4] arguments separated by whitespace:
#
# action motion [finger_count] command
#
# where action and motion is either:
# swipe up
# swipe down
# swipe left
# swipe right
# swipe left_up
# swipe left_down
# swipe right_up
# swipe right_down
# pinch in
# pinch out
# pinch clockwise
# pinch anticlockwise
#
# command is the remainder of the line and is any valid shell command +
# arguments.
#
# finger_count is a single numeric digit and is optional (and is
# typically 3 or 4). If specified then the command is executed when
# exactly that number of fingers is used in the gesture. If not
# specified then the command is executed when that gesture is executed
# with any number of fingers. Gesture lines specified with finger_count
# have priority over the same gesture specified without any
# finger_count.
#
# Typically command will be _internal, or xdotool. See "man xdotool" for
# the many things you can action with that tool. Note that unfortunately
# xdotool does not work with native Wayland clients.
###############################################################################
# SWIPE GESTURES:
###############################################################################
# Note the default is an "internal" command that uses wmctrl to switch
# workspaces and, unlike xdotool, works on both Xorg and Wayland (via
# XWayland). It also can be configured for vertical and horizontal
# switching over tabular workspaces, as per the example below. You can
# also add "-w" to the internal command to allow wrapping workspaces.
# Ensure you install wmctrl if you use _internal.
# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe up 4 _internal ws_up
# NOTE ABOUT FINGER COUNT:
# The above command will configure this command for all fingers (i.e. 3
# for 4) but to configure it for 3 fingers only, change it to:
# gesture swipe up 3 _internal ws_up
# Then you can configure something else for 4 fingers or leave 4 fingers
# unconfigured. You can configure an explicit finger count like this for
# all example commands in this configuration file.
#
# gesture swipe up xdotool key super+Page_Down
# KDE Plasma open/close overview
gesture swipe up 3 xdotool key ctrl+F10
gesture swipe down 3 xdotool key ctrl+F10
# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg)
gesture swipe down 4 _internal ws_down
# gesture swipe down xdotool key super+Page_Up
gesture swipe left 4 _internal ws_left
gesture swipe right 4 _internal ws_right
# Browser go forward and back (works only for Xorg, and Xwayland clients)
gesture swipe left xdotool key alt+Right
gesture swipe right xdotool key alt+Left
# NOTE: If you don't use "natural" scrolling direction for your touchpad
# then you may want to swap the above default left/right and up/down
# configurations.
# Optional extended swipe gestures, e.g. for browser tab navigation:
#
# Jump to next open browser tab
# gesture swipe right_up xdotool key control+Tab
#
# Jump to previous open browser tab
# gesture swipe left_up xdotool key control+shift+Tab
#
# Close current browser tab
# gesture swipe left_down xdotool key control+w
#
# Reopen and jump to last closed browser tab
# gesture swipe right_down xdotool key control+shift+t
# Example of 8 static workspaces, e.g. using KDE virtual-desktops,
# arranged in 2 rows of 4 columns across using swipe up/down/left/right
# to navigate in fixed planes. You can also add the "-w/--wrap" option
# to allow wrapping in any direction. You must configure your virtual
# desktops with the same column dimension.
# gesture swipe up _internal --cols 4 ws_up
# gesture swipe down _internal --cols 4 ws_down
# gesture swipe left _internal --cols 4 ws_left
# gesture swipe right _internal --cols 4 ws_right
#
# Example of 16 static workspaces, e.g. using KDE virtual-desktops,
# arranged in 4 rows of 4 columns across using swipe up/down/left/right
# to navigate in fixed planes, and also using swipe
# left_up/left_down/right_up/right_down to navigate diagonally. You can
# also add the "-w/--wrap" option to allow wrapping in any direction
# and/or diagonally. You must configure your virtual desktops with the
# same column dimension.
# gesture swipe up _internal --cols 4 ws_up
# gesture swipe down _internal --cols 4 ws_down
# gesture swipe left _internal --cols 4 ws_left
# gesture swipe right _internal --cols 4 ws_right
# gesture swipe left_up _internal --cols 4 ws_left_up
# gesture swipe left_down _internal --cols 4 ws_left_down
# gesture swipe right_up _internal --cols 4 ws_right_up
# gesture swipe right_down _internal --cols 4 ws_right_down
# Example virtual desktop switching for Ubuntu Unity/Compiz. The
# _internal command does not work for Compiz but you can explicitly
# configure the swipe commands to work for a Compiz virtual 2
# dimensional desktop as follows:
# gesture swipe up xdotool key ctrl+alt+Up
# gesture swipe down xdotool key ctrl+alt+Down
# gesture swipe left xdotool key ctrl+alt+Left
# gesture swipe right xdotool key ctrl+alt+Right
###############################################################################
# PINCH GESTURES:
###############################################################################
# GNOME SHELL open/close overview (works for GNOME on Xorg only)
#gesture pinch in xdotool key super+s
#gesture pinch out xdotool key super+s
# GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg)
# Note since GNOME 3.24 on Wayland this is implemented natively so no
# real point configuring for Wayland.
# gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
# gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
# Example to change audio volume:
# Note this only works on an Xorg desktop (not Wayland).
# gesture swipe up xdotool key XF86AudioRaiseVolume
# gesture swipe down xdotool key XF86AudioLowerVolume
# Optional extended pinch gestures:
gesture pinch clockwise xdotool key XF86AudioRaiseVolume
gesture pinch anticlockwise xdotool key XF86AudioLowerVolume
###############################################################################
# This application normally determines your touchpad device
# automatically. Some users may have multiple touchpads but by default
# we use only the first one found. However, you can choose to specify
# the explicit device name to use. Run "libinput list-devices" to work
# out the name of your device (from the "Device:" field). Then add a
# device line specifying that name, e.g:
#
# device DLL0665:01 06CB:76AD Touchpad
#
# If the device name starts with a '/' then it is instead considered as
# the explicit device path although since device paths can change
# through reboots this is best to be a symlink. E.g. instead of specifying
# /dev/input/event12, you should use the corresponding full path link
# under /dev/input/by-path/ or /dev/input/by-id/.
#
# You can choose to use ALL touchpad devices by setting the device name
# to "all". E.g. Do this if you have multiple touchpads which you want
# to use in parallel. This reduces performance slightly so only set this
# if you have to.
#
# device all
###############################################################################
# You can set a minimum travel distance threshold before swipe gestures
# are actioned using the swipe_threshold configuration command.
# Specify this value in dots. The default is 0.
# E.g. set it to 100 dots with "swipe_threshold 100".
# swipe_threshold 0
###############################################################################
# You can set a timeout on gestures from start to end. The default is
# the value commented below. It can be any value in float secs >= 0.
# 0 = no timeout. E.g. set it to 2 secs with "timeout 2".
# timeout 1.5

View file

@ -230,8 +230,8 @@ blur: {
# requires: https://github.com/ibhagwan/picom # requires: https://github.com/ibhagwan/picom
method = "dual_kawase"; method = "dual_kawase";
#method = "kernel"; #method = "kernel";
strength = 8; strength = 12;
# deviation = 1.0; deviation = 1.0;
# kernel = "11x11gaussian"; # kernel = "11x11gaussian";
background = false; background = false;
background-frame = false; background-frame = false;

View file

@ -13,7 +13,7 @@ mod="Mod4"
# Mod+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) # Mod+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot)
riverctl map normal $mod Return spawn alacritty riverctl map normal $mod Return spawn alacritty
riverctl map normal $mod E spawn emacsclient -c -a 'emacs' riverctl map normal $mod E spawn emacsclient -c -a 'emacs'
riverctl map normal Menu wofi --show drun riverctl map normal Menu spawn rofi -no-lazy-grab -show run -modi run
# Mod+Q to close the focused view # Mod+Q to close the focused view
riverctl map normal $mod C close riverctl map normal $mod C close
@ -39,7 +39,7 @@ riverctl map normal $mod+Shift Period send-to-output next
riverctl map normal $mod+Shift Comma send-to-output previous riverctl map normal $mod+Shift Comma send-to-output previous
# Mod+Return to bump the focused view to the top of the layout stack # Mod+Return to bump the focused view to the top of the layout stack
riverctl map normal $mod Return zoom # riverctl map normal $mod Return zoom
# Mod+H and Mod+L to decrease/increase the main factor by 5% # Mod+H and Mod+L to decrease/increase the main factor by 5%
# If using rivertile(1) this determines the width of the main stack. # If using rivertile(1) this determines the width of the main stack.
@ -147,19 +147,27 @@ do
done done
# Set repeat rate # Set repeat rate
riverctl set-repeat 120 220 riverctl set-repeat 180 200
# Set the layout on startup # Set the layout on startup
riverctl layout rivertile left riverctl layout rivertile
# Set app-ids of views which should float # Set app-ids of views which should float
riverctl float-filter-add "float" riverctl float-filter-add "float"
riverctl float-filter-add "popup" riverctl float-filter-add "popup"
riverctl float-filter-add "dolphin"
# Set app-ids of views which should use client side decorations # Set app-ids of views which should use client side decorations
riverctl csd-filter-add "gedit" riverctl csd-filter-add "gedit"
# Set opacity and fade effect # Set opacity and fade effect
riverctl opacity 0.8 0.45 0.0 0.1 20 riverctl opacity 0.8 0.45 0.0 0.1 20
# Set cursor theme
riverctl xcursor-theme breeze-snow
# Set layout
wlr-randr --output eDP-1 --pos 0,0 --scale 2 wlr-randr --output eDP-1 --pos 0,0 --scale 2
# Turn on Waybar
waybar waybar

View file

@ -10,4 +10,4 @@ configuration {
run-command: "fish -c {cmd}"; run-command: "fish -c {cmd}";
run-list-command: "fish -c functions"; run-list-command: "fish -c functions";
} }
@import "/home/chris/.dotfiles/rofi/launchers-git/desktop.rasi" @import "/home/chris/.dotfiles/rofi/launchers-git/laptop.rasi"

View file

@ -2,4 +2,6 @@
# awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \ # awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \
# <(rg 'cpu ' /proc/stat) <(sleep 1;rg 'cpu ' /proc/stat) # <(rg 'cpu ' /proc/stat) <(sleep 1;rg 'cpu ' /proc/stat)
# echo 100 - $(mpstat | rg all | cut -d \ -f43) | bc # echo 100 - $(mpstat | rg all | cut -d \ -f43) | bc
mpstat 1 1 | rg Average | awk '{print $3+$4+$5}' | sed 's/\(.*\)/\1%/g' cpu="$(mpstat 1 1 | rg Average | awk '{print $3+$4+$5}' | sed 's/\(.*\)/\1%/g')"
echo $cpu

7
scripts/cpu-plasma Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \
# <(rg 'cpu ' /proc/stat) <(sleep 1;rg 'cpu ' /proc/stat)
# echo 100 - $(mpstat | rg all | cut -d \ -f43) | bc
cpu="$(mpstat 1 1 | rg Average | awk '{print $3+$4+$5}' | sed 's/\(.*\)/\1%/g')"
echo "$cpu | color=#ff0000"

1
scripts/launcher.sh Symbolic link
View file

@ -0,0 +1 @@
/home/chris/.dotfiles/rofi/launchers-git/launcher.sh

2
scripts/libinput-gestures Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
libinput-gestures &

View file

@ -58,6 +58,7 @@ border_images.urgent /home/chris/.dotfiles/sway/rounded_and_shadows_custom.png
font pango: VictorMono Nerd Font 10 font pango: VictorMono Nerd Font 10
titlebar_border_thickness 1 titlebar_border_thickness 1
### Key bindings ### Key bindings
# #
# Basics: # Basics:
@ -71,9 +72,10 @@ titlebar_border_thickness 1
# Start your launcher # Start your launcher
bindsym Menu exec $menu bindsym Menu exec $menu
bindsym $mod+Menu exec rofi -no-lazy-grab -show run -modi run | xargs swaymsg exec -- bindsym $mod+Menu exec rofi -no-lazy-grab -show run -modi run | xargs swaymsg exec --
bindsym $mod+s exec filesearch
#Pass #Pass
bindsym $mod+p exec rofi-rbw bindsym $mod+p exec rofi-pass
# Screenshot # Screenshot
bindsym Print exec grim -g "${slurp}" - | wl-copy bindsym Print exec grim -g "${slurp}" - | wl-copy
@ -150,7 +152,7 @@ titlebar_border_thickness 1
bindsym $mod+v splitv bindsym $mod+v splitv
# Switch the current container between different layout styles # Switch the current container between different layout styles
bindsym $mod+s layout stacking bindsym $mod+t layout stacking
bindsym $mod+w layout tabbed bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split bindsym $mod+e layout toggle split
@ -225,7 +227,7 @@ mode "$mode_launcher" {
bindsym e exec emacsclient -c -a emacs & bindsym e exec emacsclient -c -a emacs &
bindsym b exec qutebrowser bindsym b exec qutebrowser
bindsym a exec emacsclient -c -e '(org-agenda)' bindsym a exec emacsclient -c -e '(org-agenda)'
bindsym i exec emacsclient -c -e '(mu4e)' bindsym m exec emacsclient -c -e '(mu4e)'
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
} }
@ -239,11 +241,15 @@ bar {
workspace_buttons yes workspace_buttons yes
} }
for_window [app_id="mpv"] floating enable for_window [app_id="mpv"] floating enable
for_window [app_id="imv"] floating enable for_window [app_id="imv"] floating enable
for_window [app_id="dolphin"] floating enable for_window [app_id="dolphin"] floating enable
for_window [app_id="pulsemixer"] floating enable
for_window [app_id="qutebrowser"] move container to workspace number 2 for_window [app_id="qutebrowser"] move container to workspace number 2
for_window [app_id="qutebrowser"] opacity 1
for_window [app_id="emacs"] opacity 0.95 for_window [app_id="emacs"] opacity 0.95
#for_window [app_id="__focused__"] opacity 1
exec emacs --daemon exec emacs --daemon
exec mako exec mako