diff --git a/nord/.config/libinput-gestures.conf b/nord/.config/libinput-gestures.conf new file mode 100644 index 00000000..8f1c8728 --- /dev/null +++ b/nord/.config/libinput-gestures.conf @@ -0,0 +1,194 @@ +# 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 xdotool key super+Shift+j + +# 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 + +# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg) +gesture swipe down xdotool key super+Shift+k +# gesture swipe down xdotool key super+Page_Up + +# Browser go forward (works only for Xorg, and Xwayland clients) +gesture swipe left xdotool key super+Control+Right + +# Browser go back (works only for Xorg, and Xwayland clients) +gesture swipe right xdotool key super+Control+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 + +# 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 + +############################################################################### +# PINCH GESTURES: +############################################################################### + +# GNOME SHELL open/close overview (works for GNOME on Xorg only) +gesture pinch in xdotool key super+Return +gesture pinch out xdotool key super+q + +# KDE Plasma open/close overview +# gesture pinch in xdotool key ctrl+F9 +# gesture pinch out xdotool key ctrl+F9 + +# 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();' + +# Optional extended pinch gestures: +# gesture pinch clockwise +# gesture pinch anticlockwise + +############################################################################### +# 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 diff --git a/nord/.dwm-ori/autostart.sh b/nord/.dwm-ori/autostart.sh index 642daa8f..697d7335 100755 --- a/nord/.dwm-ori/autostart.sh +++ b/nord/.dwm-ori/autostart.sh @@ -2,7 +2,7 @@ sh ~/.fehbg -arr=("goblocks" "xfce4-power-manager" "copyq" "fcitx5" "dunst" "xdman" "clipmenud" "qv2ray" "redshift-gtk" "mpd" "picom" "conky") +arr=("goblocks" "xfce4-power-manager" "copyq" "fcitx5" "dunst" "clipmenud" "mpd" "picom" "qv2ray" "solaar") for value in ${arr[@]} do diff --git a/nord/.dwm-ori/config.def.h b/nord/.dwm-ori/config.def.h index 09391292..76ea2d77 100644 --- a/nord/.dwm-ori/config.def.h +++ b/nord/.dwm-ori/config.def.h @@ -94,6 +94,7 @@ static const Rule rules[] = { {"Spotify", "spotify", NULL, 1 << 3, 0, -1}, {"YesPlayMusic", NULL, NULL, 1 << 3, 0, -1}, {"Netease-cloud-music-gtk", NULL, NULL, 1 << 3, 0, -1}, + {"netease-cloud-music", NULL, NULL, 1 << 3, 0, -1}, {"Steam", NULL, NULL, 1 << 4, 0, -1}, @@ -107,6 +108,7 @@ static const Rule rules[] = { {"TelegramDesktop", NULL, NULL, 1 << 7, 0, -1}, {"qv2ray", NULL, NULL, 1 << 8, 0, -1}, + {"qBittorrent", NULL, NULL, 1 << 8, 0, -1}, {"xdman-Main", NULL, NULL, 0, 1, -1}, {"Nitrogen", NULL, NULL, 0, 1, -1}, @@ -169,6 +171,9 @@ static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-3%", static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL}; +static const char *upbrt[] = {"light", "-A", "5", NULL}; +static const char *downbrt[] = {"light", "-U", "5", NULL}; + static Key keys[] = { /* modifier key function argument */ {MODKEY, XK_Return, spawn, {.v = termcmd}}, @@ -216,6 +221,10 @@ static Key keys[] = { {MODKEY, XK_equal, setgaps, {.i = +5}}, {MODKEY | ShiftMask, XK_minus, setgaps, {.i = GAP_RESET}}, {MODKEY | ShiftMask, XK_equal, setgaps, {.i = GAP_TOGGLE}}, + {MODKEY | ShiftMask, XK_j, shiftviewclients, {.i = +1}}, + {MODKEY | ShiftMask, XK_k, shiftviewclients, {.i = -1}}, + {MODKEY | ControlMask, XK_Right, shiftview, {.i = +1}}, + {MODKEY | ControlMask, XK_Left, shiftview, {.i = -1}}, {MODKEY, XK_F5, xrdb, {.v = NULL}}, /* My Own App Start Ways */ @@ -234,8 +243,8 @@ static Key keys[] = { {MODKEY | ShiftMask, XK_v, spawn, CMD("VBoxManage startvm 'Windows10' --type gui")}, - {Mod1Mask | ControlMask, XK_Delete, spawn, CMD("sh ~/.local/bin/lock")}, - {Mod1Mask | ControlMask, XK_s, spawn, CMD("sh /usr/local/bin/suspend")}, + {Mod1Mask | ControlMask, XK_Delete, spawn, + CMD("/usr/bin/betterlockscreen -l")}, /*IDE start*/ {Mod1Mask, XK_i, spawn, CMD("idea")}, @@ -264,6 +273,8 @@ static Key keys[] = { {0, XF86XK_AudioMute, spawn, {.v = mutevol}}, {0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}}, {0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}}, + {0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}}, + {0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}}, TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3) TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7) diff --git a/nord/.dwm-ori/config.h b/nord/.dwm-ori/config.h index 09391292..76ea2d77 100644 --- a/nord/.dwm-ori/config.h +++ b/nord/.dwm-ori/config.h @@ -94,6 +94,7 @@ static const Rule rules[] = { {"Spotify", "spotify", NULL, 1 << 3, 0, -1}, {"YesPlayMusic", NULL, NULL, 1 << 3, 0, -1}, {"Netease-cloud-music-gtk", NULL, NULL, 1 << 3, 0, -1}, + {"netease-cloud-music", NULL, NULL, 1 << 3, 0, -1}, {"Steam", NULL, NULL, 1 << 4, 0, -1}, @@ -107,6 +108,7 @@ static const Rule rules[] = { {"TelegramDesktop", NULL, NULL, 1 << 7, 0, -1}, {"qv2ray", NULL, NULL, 1 << 8, 0, -1}, + {"qBittorrent", NULL, NULL, 1 << 8, 0, -1}, {"xdman-Main", NULL, NULL, 0, 1, -1}, {"Nitrogen", NULL, NULL, 0, 1, -1}, @@ -169,6 +171,9 @@ static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-3%", static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL}; +static const char *upbrt[] = {"light", "-A", "5", NULL}; +static const char *downbrt[] = {"light", "-U", "5", NULL}; + static Key keys[] = { /* modifier key function argument */ {MODKEY, XK_Return, spawn, {.v = termcmd}}, @@ -216,6 +221,10 @@ static Key keys[] = { {MODKEY, XK_equal, setgaps, {.i = +5}}, {MODKEY | ShiftMask, XK_minus, setgaps, {.i = GAP_RESET}}, {MODKEY | ShiftMask, XK_equal, setgaps, {.i = GAP_TOGGLE}}, + {MODKEY | ShiftMask, XK_j, shiftviewclients, {.i = +1}}, + {MODKEY | ShiftMask, XK_k, shiftviewclients, {.i = -1}}, + {MODKEY | ControlMask, XK_Right, shiftview, {.i = +1}}, + {MODKEY | ControlMask, XK_Left, shiftview, {.i = -1}}, {MODKEY, XK_F5, xrdb, {.v = NULL}}, /* My Own App Start Ways */ @@ -234,8 +243,8 @@ static Key keys[] = { {MODKEY | ShiftMask, XK_v, spawn, CMD("VBoxManage startvm 'Windows10' --type gui")}, - {Mod1Mask | ControlMask, XK_Delete, spawn, CMD("sh ~/.local/bin/lock")}, - {Mod1Mask | ControlMask, XK_s, spawn, CMD("sh /usr/local/bin/suspend")}, + {Mod1Mask | ControlMask, XK_Delete, spawn, + CMD("/usr/bin/betterlockscreen -l")}, /*IDE start*/ {Mod1Mask, XK_i, spawn, CMD("idea")}, @@ -264,6 +273,8 @@ static Key keys[] = { {0, XF86XK_AudioMute, spawn, {.v = mutevol}}, {0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}}, {0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}}, + {0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}}, + {0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}}, TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3) TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7) diff --git a/nord/.dwm-ori/drw.o b/nord/.dwm-ori/drw.o index a27b855c..7cfab932 100644 Binary files a/nord/.dwm-ori/drw.o and b/nord/.dwm-ori/drw.o differ diff --git a/nord/.dwm-ori/dwm b/nord/.dwm-ori/dwm index 6e93a64c..6f6776d0 100755 Binary files a/nord/.dwm-ori/dwm and b/nord/.dwm-ori/dwm differ diff --git a/nord/.dwm-ori/dwm.1 b/nord/.dwm-ori/dwm.1 index 6655eb68..ce7b05b6 100644 --- a/nord/.dwm-ori/dwm.1 +++ b/nord/.dwm-ori/dwm.1 @@ -94,6 +94,18 @@ Send focused window to previous screen, if any. .B Mod1\-Shift\-. Send focused window to next screen, if any. .TP +.B Mod1\-Right +Focus tag on the right, if any. +.TP +.B Mod1\-Left +Focus tag on the left, if any. +.TP +.B Mod1\-Shift\-Right +Send focused window to tag on the right, if any. +.TP +.B Mod1\-Shift\-Left +Send focused window to tag on the left, if any. +.TP .B Mod1\-b Toggles bar on and off. .TP diff --git a/nord/.dwm-ori/dwm.c b/nord/.dwm-ori/dwm.c index d643f710..de332e51 100644 --- a/nord/.dwm-ori/dwm.c +++ b/nord/.dwm-ori/dwm.c @@ -319,6 +319,8 @@ static void updatetitle(Client *c); static void updatewindowtype(Client *c); static void updatewmhints(Client *c); static void view(const Arg *arg); +static void viewtoleft(const Arg *arg); +static void viewtoright(const Arg *arg); static Client *wintoclient(Window w); static Monitor *wintomon(Window w); static int xerror(Display *dpy, XErrorEvent *ee); @@ -328,8 +330,9 @@ static void xrdb(const Arg *arg); static void zoom(const Arg *arg); static void bstack(Monitor *m); static void bstackhoriz(Monitor *m); - static void focusmaster(const Arg *arg); +static void shiftview(const Arg *arg); +static void shiftviewclients(const Arg *arg); /* variables */ static const char autostartblocksh[] = "autostart_blocking.sh"; @@ -372,6 +375,7 @@ static Window root, wmcheckwin; /* configuration, allows nested code to access above variables */ #include "config.h" +static unsigned int scratchtag = 1 << LENGTH(tags); struct Pertag { unsigned int curtag, prevtag; /* current and previous tag */ @@ -3061,3 +3065,39 @@ static void bstackhoriz(Monitor *m) { } } } + +void shiftview(const Arg *arg) { + Arg shifted; + + if (arg->i > 0) // left circular shift + shifted.ui = (selmon->tagset[selmon->seltags] << arg->i) | + (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i)); + + else // right circular shift + shifted.ui = selmon->tagset[selmon->seltags] >> (-arg->i) | + selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i); + + view(&shifted); +} + +void shiftviewclients(const Arg *arg) { + Arg shifted; + Client *c; + unsigned int tagmask = 0; + int NUMTAGS = LENGTH(tags); + + for (c = selmon->clients; c; c = c->next) + tagmask |= c->tags; + + shifted.ui = selmon->tagset[selmon->seltags] &= ~scratchtag; + if (arg->i > 0) // left circular shift + do { + shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (NUMTAGS - arg->i)); + } while (tagmask && !(shifted.ui & tagmask)); + else // right circular shift + do { + shifted.ui = (shifted.ui >> -arg->i) | (shifted.ui << (NUMTAGS + arg->i)); + } while (tagmask && !(shifted.ui & tagmask)); + + view(&shifted); +} diff --git a/nord/.dwm-ori/dwm.o b/nord/.dwm-ori/dwm.o index 6f1738ed..5e0e5320 100644 Binary files a/nord/.dwm-ori/dwm.o and b/nord/.dwm-ori/dwm.o differ diff --git a/nord/.dwm-ori/recompile b/nord/.dwm-ori/recompile index 26593722..102ea036 100755 --- a/nord/.dwm-ori/recompile +++ b/nord/.dwm-ori/recompile @@ -1,4 +1,4 @@ #!/bin/bash rm -f ./config.h -doas make clean install +sudo make clean install diff --git a/nord/.dwm-ori/util.o b/nord/.dwm-ori/util.o index 71c79579..5dee2d71 100644 Binary files a/nord/.dwm-ori/util.o and b/nord/.dwm-ori/util.o differ