mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-07-01 06:50:17 +02:00
meta: Remove sxhkd
What a ride. Although I absolutely loved configuring my keybinds through sxhkd, more so than i3 / sway and similar window managers, I didn't realize that most of what I was doing under bspwm could also be accomplished under GNOME through gsettings.
This commit is contained in:
@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
||||||
# Copyright (C) 2018 Donovan Glover
|
|
||||||
|
|
||||||
# TODO: Run this script when launching stuff, so we can use super+\ to launch anything + hide it again, and have terminal access
|
|
||||||
|
|
||||||
DROPDOWN_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
|
|
||||||
DROPDOWN_SCALE=$(($DROPDOWN_DPI / 96))
|
|
||||||
|
|
||||||
c='kitty' # Class
|
|
||||||
i='dropdown' # Instance
|
|
||||||
x='kitty --name' # Executable
|
|
||||||
|
|
||||||
# Note: This solution will not work with termite since it registers two ids.
|
|
||||||
# See https://github.com/thestinger/termite/issues/634 for more information.
|
|
||||||
|
|
||||||
id=$(xdo id -n $i)
|
|
||||||
rectangle=$((1700 * $DROPDOWN_SCALE))x$((600 * $DROPDOWN_SCALE))
|
|
||||||
offset=+$((110 * $DROPDOWN_SCALE))+$((100 * $DROPDOWN_SCALE))
|
|
||||||
# TODO: Use small window when holding shift
|
|
||||||
# TODO: Just use fullscreen from native bspwm/xorg instead of manually setting size
|
|
||||||
# rectangle=$((1920 * $DROPDOWN_SCALE))x$((1080 * $DROPDOWN_SCALE))
|
|
||||||
# offset=+$((0 * $DROPDOWN_SCALE))+$((0 * $DROPDOWN_SCALE))
|
|
||||||
|
|
||||||
bspc rule -r $c:$i
|
|
||||||
bspc rule -a $c:$i sticky=on state=floating rectangle=$rectangle$offset
|
|
||||||
|
|
||||||
([ -z "$id" ]) && ($x $i) ||
|
|
||||||
([[ $(xprop -id "$id" | awk '/window state: / {print $3}') == 'Withdrawn' ]] &&
|
|
||||||
xdo show -n $i || xdo hide -n $i)
|
|
@ -1,23 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SOCK=$(fd kitty --base-directory /tmp -d 1)
|
|
||||||
KITTY=$(xdotool search --class kitty)
|
|
||||||
|
|
||||||
[ -e "/tmp/opacity-of-terminal" ] || echo 0.9 > /tmp/opacity-of-terminal
|
|
||||||
|
|
||||||
[ "$1" == "up" ] && \
|
|
||||||
NEXT=$(fish -N -c "math (cat /tmp/opacity-of-terminal) + 0.02") ||
|
|
||||||
NEXT=$(fish -N -c "math (cat /tmp/opacity-of-terminal) - 0.02")
|
|
||||||
|
|
||||||
[ "$1" == "up" ] && [ "$(cat /tmp/opacity-of-terminal)" == "1" ] && NEXT=1
|
|
||||||
[ "$1" == "down" ] && [ "$(cat /tmp/opacity-of-terminal)" == "0" ] && NEXT=0
|
|
||||||
|
|
||||||
echo "$NEXT" > /tmp/opacity-of-terminal
|
|
||||||
|
|
||||||
[ "$1" == "up" ] && \
|
|
||||||
notify-send -t 1000 "kitty" "Increased opacity to $NEXT" ||
|
|
||||||
notify-send -t 1000 "kitty" "Decreased opacity to $NEXT"
|
|
||||||
|
|
||||||
[ -n "$KITTY" ] && \
|
|
||||||
([ -e "/tmp/$SOCK" ] && \
|
|
||||||
(kitty @ --to "unix:/tmp/$SOCK" set-background-opacity "$NEXT"))
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SOCK=$(fd kitty --base-directory /tmp -d 1)
|
|
||||||
KITTY=$(xdotool search --class kitty)
|
|
||||||
|
|
||||||
[ -n "$KITTY" ] && \
|
|
||||||
([ -e "/tmp/$SOCK" ] && \
|
|
||||||
(kitty @ --to "unix:/tmp/$SOCK" launch --type=tab && \
|
|
||||||
bspc node $KITTY -f)) \
|
|
||||||
|| kitty --single-instance --start-as maximized
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
||||||
# Copyright (C) 2017-2018 Donovan Glover
|
|
||||||
|
|
||||||
SCREENSHOT_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
|
|
||||||
SCREENSHOT_SCALE=$(($SCREENSHOT_DPI / 96))
|
|
||||||
|
|
||||||
DATETIME=`date +%F_%H%M%S`
|
|
||||||
shotgun ~/$DATETIME.png
|
|
||||||
notify-send -t 2000 "Screenshot saved as" "$DATETIME.png"
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
DATETIME=`date +%F_%H%M%S`
|
|
||||||
|
|
||||||
if [[ "$1" == "clipboard" ]]; then
|
|
||||||
shotgun $(hacksaw -f "-i %i -g %g") - | xclip -t 'image/png' -selection clipboard
|
|
||||||
else
|
|
||||||
shotgun $(hacksaw -f "-i %i -g %g") ~/$DATETIME.png
|
|
||||||
fi
|
|
@ -1,151 +0,0 @@
|
|||||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
||||||
# Copyright (C) 2017-2018 Donovan Glover
|
|
||||||
|
|
||||||
# Reload sxhkd / Quit bspwm
|
|
||||||
super + {_, alt} + Escape
|
|
||||||
{pkill -USR1 -x sxhkd && notify-send -t 2000 "sxhkd" "Reloaded config",bspc quit}
|
|
||||||
|
|
||||||
super + d
|
|
||||||
libinput-gestures-setup restart && notify-send -t 2000 "libinput-gestures" "Reloaded config"
|
|
||||||
|
|
||||||
# Dynamically adjust gaps of current desktop
|
|
||||||
super + {_, shift +} g
|
|
||||||
{ bspc config -d focused window_gap $(( $(bspc config -d focused window_gap) + 10 )), \
|
|
||||||
[ $(bspc config -d focused window_gap) -ge 20 ] && \
|
|
||||||
bspc config -d focused window_gap $(( $(bspc config -d focused window_gap) - 10 )) }
|
|
||||||
|
|
||||||
# Dynamically adjust borders of nodes on current desktop
|
|
||||||
super + {_, shift +} i
|
|
||||||
{ bspc config -d focused border_width $(( $(bspc config -d focused border_width) + 1 )), \
|
|
||||||
[ $(bspc config -d focused border_width) -ge 1 ] && \
|
|
||||||
bspc config -d focused border_width $(( $(bspc config -d focused border_width) - 1 )) }
|
|
||||||
|
|
||||||
# Take a screenshot
|
|
||||||
super + p
|
|
||||||
~/.config/sxhkd/screenshot.sh
|
|
||||||
|
|
||||||
# Screenshot a selection
|
|
||||||
super + {shift,alt} + p
|
|
||||||
~/.config/sxhkd/selection.sh {_,clipboard}
|
|
||||||
|
|
||||||
# Open a new terminal window
|
|
||||||
super + {_,shift} + Return
|
|
||||||
~/.config/sxhkd/kitty.sh
|
|
||||||
|
|
||||||
# Toggle a dropdown terminal
|
|
||||||
super + backslash
|
|
||||||
~/.config/sxhkd/dropdown.sh
|
|
||||||
|
|
||||||
# TODO: Replace old polybar keybind with status notification
|
|
||||||
# toggle tint2: bottom_padding depends on the panel_size you set in tint2rc
|
|
||||||
super + o
|
|
||||||
(xdotool search --class --onlyvisible "tint2" && \
|
|
||||||
(xdo hide -n "tint2" && bspc config bottom_padding 0)) || \
|
|
||||||
(xdo show -n "tint2" && bspc config bottom_padding 30)
|
|
||||||
|
|
||||||
# Change the wal color scheme
|
|
||||||
super + m
|
|
||||||
wal -o ~/.config/wal/done.sh --theme random_dark -e
|
|
||||||
|
|
||||||
super + z
|
|
||||||
wal -o ~/.config/wal/done.sh -i ~/bgs -e
|
|
||||||
|
|
||||||
super + r
|
|
||||||
wal -o ~/.config/wal/done.sh -R -e
|
|
||||||
|
|
||||||
alt + F1
|
|
||||||
~/.config/rofi/launch.sh
|
|
||||||
|
|
||||||
super + {equal,minus}
|
|
||||||
~/.config/sxhkd/kitty-next.sh {up,down}
|
|
||||||
|
|
||||||
# ====================
|
|
||||||
# ======= Node =======
|
|
||||||
# ====================
|
|
||||||
|
|
||||||
# Close the focused window
|
|
||||||
super + {_,shift} + q
|
|
||||||
bspc node -{c,k}
|
|
||||||
|
|
||||||
# Switch to / Swap with the node in the specified direction
|
|
||||||
super + {_,shift} + {h,j,k,l}
|
|
||||||
bspc node -{f,s} {west,south,north,east}
|
|
||||||
|
|
||||||
# FLAGS: Toggle between node flags
|
|
||||||
super + {x,y}
|
|
||||||
bspc node -g {sticky,private}
|
|
||||||
|
|
||||||
# FLAGS: Push and pop windows from the hidden stack
|
|
||||||
super + {_,shift} + b
|
|
||||||
bspc node {-g hidden,$(bspc query -N -n .hidden | tail -n 1) -g hidden=off}
|
|
||||||
|
|
||||||
# STATES: Toggle between node states
|
|
||||||
super + {t,w,f,space}
|
|
||||||
bspc node focused -t ~{tiled,pseudo_tiled,fullscreen,floating}
|
|
||||||
|
|
||||||
# PRESELECT: The direction to create a new node
|
|
||||||
super + ctrl + {h,j,k,l,space}
|
|
||||||
bspc node -p {west,south,north,east,cancel}
|
|
||||||
|
|
||||||
# RATIO: The size of a new node
|
|
||||||
super + ctrl + {1-9}
|
|
||||||
bspc node -o 0.{1-9}
|
|
||||||
|
|
||||||
# =======================
|
|
||||||
# ======= Desktop =======
|
|
||||||
# =======================
|
|
||||||
|
|
||||||
# Focus a certain desktop / Send a node to a certain desktop
|
|
||||||
super + {_,shift} + {1-9,0}
|
|
||||||
bspc {desktop -f,node -d} '^{1-9,10}'
|
|
||||||
|
|
||||||
# Move to the next desktop on the current monitor
|
|
||||||
super + {_, shift} + Tab
|
|
||||||
bspc desktop -f {next,prev}.local.occupied
|
|
||||||
|
|
||||||
# Easily go back and forth between the last desktop used
|
|
||||||
super + a
|
|
||||||
bspc desktop -f last
|
|
||||||
|
|
||||||
# Switch between tiled and monocle desktop layouts
|
|
||||||
super + c
|
|
||||||
bspc desktop -l next
|
|
||||||
|
|
||||||
# =======================
|
|
||||||
# ======= fn keys =======
|
|
||||||
# =======================
|
|
||||||
|
|
||||||
super + F1
|
|
||||||
pactl set-sink-mute @DEFAULT_SINK@ toggle && notify-send -t 2000 "Changed muted to" "$(pamixer --get-mute)"
|
|
||||||
|
|
||||||
super + F2
|
|
||||||
pamixer -d 5 && notify-send -t 2000 "Lowered volume to" "$(pamixer --get-volume)%"
|
|
||||||
|
|
||||||
super + F3
|
|
||||||
pamixer -i 5 && notify-send -t 2000 "Raised volume to" "$(pamixer --get-volume)%"
|
|
||||||
|
|
||||||
super + F4
|
|
||||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
|
||||||
|
|
||||||
super + F5
|
|
||||||
brightnessctl set 5%- && notify-send -t 2000 "Decreased brightness to" "$(brightnessctl get)"
|
|
||||||
|
|
||||||
super + F6
|
|
||||||
brightnessctl set +5% && notify-send -t 2000 "Increased brightness to" "$(brightnessctl get)"
|
|
||||||
|
|
||||||
super + F7
|
|
||||||
playerctl -p mpv previous && notify-send -t 2000 "Previous track" "$(playerctl -p mpv metadata xesam:title)"
|
|
||||||
|
|
||||||
super + F8
|
|
||||||
playerctl -p mpv next && notify-send -t 2000 "Next track" "$(playerctl -p mpv metadata xesam:title)"
|
|
||||||
|
|
||||||
super + F9
|
|
||||||
playerctl -p mpv play-pause && notify-send -t 2000 "mpv" "$(playerctl -p mpv status)"
|
|
||||||
|
|
||||||
super + F10
|
|
||||||
playerctl -p mpv position "5-" && notify-send -t 2000 "Minus 5 seconds" "$(playerctl -p mpv position)"
|
|
||||||
|
|
||||||
super + F11
|
|
||||||
playerctl -p mpv position "5+" && notify-send -t 2000 "Plus 5 seconds" "$(playerctl -p mpv position)"
|
|
||||||
|
|
||||||
# vim:ft=sxhkdrc
|
|
@ -1,16 +0,0 @@
|
|||||||
# sxhkd
|
|
||||||
|
|
||||||
[sxhkd][sxhkd] is a hotkey daemon for X11.
|
|
||||||
|
|
||||||
## Use Cases
|
|
||||||
|
|
||||||
sxhkd can be used to:
|
|
||||||
|
|
||||||
- Bind any key combination to whatever shell command you want
|
|
||||||
- Control windows in [bspwm](/bspwm) through `bspc`
|
|
||||||
|
|
||||||
You should not use sxhkd if:
|
|
||||||
|
|
||||||
- You use a desktop environment that sets keybinds for you
|
|
||||||
|
|
||||||
[sxhkd]: https://github.com/baskerville/sxhkd
|
|
Reference in New Issue
Block a user