Compare commits
No commits in common. "da611595f69f837adedc96a861fa8c5ffd618b7e" and "f9d5ac03b82036c156aa592771038abbfe39d5ed" have entirely different histories.
da611595f6
...
f9d5ac03b8
@ -3,7 +3,6 @@
|
|||||||
## Autostart Programs
|
## Autostart Programs
|
||||||
sxhkd &
|
sxhkd &
|
||||||
xsetroot -cursor_name left_ptr
|
xsetroot -cursor_name left_ptr
|
||||||
pgrep bspswallow || bspswallow &
|
|
||||||
# polybar example &
|
# polybar example &
|
||||||
#~/.scripts/panel.sh
|
#~/.scripts/panel.sh
|
||||||
if [ $(pgrep polybar) ]; then
|
if [ $(pgrep polybar) ]; then
|
||||||
|
@ -1 +0,0 @@
|
|||||||
xev
|
|
@ -1 +0,0 @@
|
|||||||
St
|
|
@ -12,9 +12,6 @@ function colors(color, theme)
|
|||||||
if color == 'gruvbox-dark-hard' then
|
if color == 'gruvbox-dark-hard' then
|
||||||
color = 'gruvbox-material'
|
color = 'gruvbox-material'
|
||||||
vim.g.gruvbox_material_background = 'hard'
|
vim.g.gruvbox_material_background = 'hard'
|
||||||
elseif color == 'gruvbox-dark-soft' then
|
|
||||||
color = 'gruvbox-material'
|
|
||||||
vim.g.gruvbox_material_background = 'soft'
|
|
||||||
end
|
end
|
||||||
if theme then
|
if theme then
|
||||||
vim.cmd.colorscheme(alt_color)
|
vim.cmd.colorscheme(alt_color)
|
||||||
|
@ -260,8 +260,18 @@ return require('packer').startup(function(use)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use 'nvim-tree/nvim-web-devicons'
|
use {
|
||||||
|
"utilyre/barbecue.nvim",
|
||||||
|
tag = "*",
|
||||||
|
requires = {
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||||
|
},
|
||||||
|
after = "nvim-web-devicons", -- keep this if you're using NvChad
|
||||||
|
config = function()
|
||||||
|
require("barbecue").setup()
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
|
@ -13,9 +13,6 @@ vim.opt.showmode = false
|
|||||||
|
|
||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
vim.opt.spell = true
|
|
||||||
vim.opt.spelllang = "en_us"
|
|
||||||
|
|
||||||
vim.opt.swapfile = false
|
vim.opt.swapfile = false
|
||||||
vim.opt.backup = false
|
vim.opt.backup = false
|
||||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
|
@ -7,23 +7,23 @@
|
|||||||
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
|
||||||
# unless explicitly requested using the wintypes option.
|
# unless explicitly requested using the wintypes option.
|
||||||
#
|
#
|
||||||
# shadow = false;
|
shadow = false;
|
||||||
shadow = true;
|
#shadow = true;
|
||||||
|
|
||||||
# The blur radius for shadows, in pixels. (defaults to 12)
|
# The blur radius for shadows, in pixels. (defaults to 12)
|
||||||
# shadow-radius = 12
|
# shadow-radius = 12
|
||||||
shadow-radius = 4;
|
shadow-radius = 5;
|
||||||
|
|
||||||
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
|
||||||
shadow-opacity = .45
|
shadow-opacity = .15
|
||||||
|
|
||||||
# The left offset for shadows, in pixels. (defaults to -15)
|
# The left offset for shadows, in pixels. (defaults to -15)
|
||||||
# shadow-offset-x = -15
|
# shadow-offset-x = -15
|
||||||
shadow-offset-x = 3;
|
shadow-offset-x = 4;
|
||||||
|
|
||||||
# The top offset for shadows, in pixels. (defaults to -15)
|
# The top offset for shadows, in pixels. (defaults to -15)
|
||||||
# shadow-offset-y = -15
|
# shadow-offset-y = -15
|
||||||
shadow-offset-y = 2;
|
shadow-offset-y = 4;
|
||||||
|
|
||||||
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
|
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
|
||||||
# you should use the *wintypes* option in your config file instead.
|
# you should use the *wintypes* option in your config file instead.
|
||||||
|
@ -22,7 +22,7 @@ screenchange-reload = true
|
|||||||
;compositing-background = screen
|
;compositing-background = screen
|
||||||
;compositing-foreground = source
|
;compositing-foreground = source
|
||||||
;compositing-border = over
|
;compositing-border = over
|
||||||
;pseudo-transparency = true
|
;pseudo-transparency = false
|
||||||
|
|
||||||
[global/wm]
|
[global/wm]
|
||||||
margin-top = 0
|
margin-top = 0
|
||||||
@ -39,78 +39,59 @@ background = ${xrdb:background}
|
|||||||
foreground = ${xrdb:foreground}
|
foreground = ${xrdb:foreground}
|
||||||
override-redirect = true
|
override-redirect = true
|
||||||
wm-restack = bspwm
|
wm-restack = bspwm
|
||||||
font-0 = Olympe Mono Hacked:style=Regular:pixelsize=20;2
|
font-0 = Olympe Mono Hacked:style=Regular:pixelsize=13;2
|
||||||
font-1 = CaskaydiaCove Nerd Font:style=Regular:pixelsize=20:2
|
font-1 = Cascadia Code:style=Regular:pixelsize=13:2
|
||||||
font-2 = NotoColorEmoji:pixelsize=20
|
font-2 = NotoColorEmoji:pixelsize=16
|
||||||
font-3 = Font Awesome 6 Brands:style=Regular:size=20;2
|
font-3 = Font Awesome 5 Brands:style=Regular:size=13;2
|
||||||
font-4 = Font Awesome 6 Free Solid:style=Regular:size=20;2
|
font-4 = Font Awesome 5 Free Solid:style=Regular:size=9;2
|
||||||
height = 36
|
height = 20
|
||||||
line-size = 2
|
line-size = 2
|
||||||
modules-left = bspwm
|
modules-left = bspwm
|
||||||
modules-right = music memory filesystem xkeyboard network redshift pulseaudio backlight tray battery datetime
|
modules-right = music pulseaudio battery network redshift datetime
|
||||||
padding = 0
|
padding = 3
|
||||||
module-margin = 1.5
|
module-margin = 1.5
|
||||||
|
|
||||||
[module/tray]
|
#[module/apple]
|
||||||
type = internal/tray
|
#type = custom/text
|
||||||
|
#content =
|
||||||
|
|
||||||
[module/xkeyboard]
|
|
||||||
type = internal/xkeyboard
|
|
||||||
format = <label-layout>
|
|
||||||
|
|
||||||
[module/filesystem]
|
|
||||||
type = internal/fs
|
|
||||||
mount-0 = /
|
|
||||||
format-mounted = <label-mounted>
|
|
||||||
label-mounted = %used% / %total%
|
|
||||||
|
|
||||||
[module/memory]
|
|
||||||
type = internal/memory
|
|
||||||
format = <label>
|
|
||||||
label = %used%
|
|
||||||
[module/bspwm]
|
[module/bspwm]
|
||||||
type = internal/bspwm
|
type = internal/bspwm
|
||||||
|
|
||||||
label-focused = %icon%
|
label-focused = %name%
|
||||||
label-focused-underline= ${xrdb:foreground}
|
label-focused-underline= ${xrdb:foreground}
|
||||||
label-focused-background = ${xrdb:foreground}
|
|
||||||
label-focused-foreground = ${xrdb:background}
|
|
||||||
label-focused-padding = 1
|
label-focused-padding = 1
|
||||||
label-focused-font = 0
|
label-focused-font = 0
|
||||||
|
|
||||||
label-occupied = %icon%
|
label-occupied = %name%
|
||||||
label-occupied-padding = 1
|
label-occupied-padding = 1
|
||||||
label-occupied-font = 0
|
label-occupied-font = 0
|
||||||
label-occupied-underline= ${xrdb:foreground}
|
|
||||||
|
|
||||||
label-urgent = %icon%
|
label-urgent = %name%!
|
||||||
label-urgent-padding = 1
|
label-urgent-padding = 1
|
||||||
label-urgent-font = 0
|
label-urgent-font = 0
|
||||||
label-urgent-background = ${xrdb:color1}
|
|
||||||
label-urgent-underline = ${xrdb:color1}
|
|
||||||
|
|
||||||
label-empty = %icon%
|
label-empty = %name%
|
||||||
label-empty-padding = 1
|
label-empty-padding = 1
|
||||||
label-empty-font = 0
|
label-empty-font = 0
|
||||||
;extra icons to choose from
|
;extra icons to choose from
|
||||||
;http://fontawesome.io/cheatsheet/
|
;http://fontawesome.io/cheatsheet/
|
||||||
; v
|
; v
|
||||||
|
|
||||||
# ws-icon-0 = 1;
|
ws-icon-0 = Web;
|
||||||
ws-icon-0 = 1;א
|
ws-icon-1 = Term;
|
||||||
ws-icon-1 = 2;ב
|
ws-icon-2 = School;
|
||||||
ws-icon-2 = 3;ג
|
ws-icon-3 = Game;
|
||||||
ws-icon-3 = 4;ד
|
ws-icon-4 = Music;
|
||||||
ws-icon-4 = 5;ה
|
ws-icon-5 = Chat;
|
||||||
ws-icon-5 = 6;ו
|
ws-icon-6 = Sys;
|
||||||
ws-icon-6 = 7;ז
|
ws-icon-7 = Dev;
|
||||||
ws-icon-7 = 8;ח
|
ws-icon-8 = Extra;
|
||||||
ws-icon-8 = 9;ט
|
|
||||||
;ws-icon-9 = 10;
|
;ws-icon-9 = 10;
|
||||||
ws-icon-default = " "
|
ws-icon-default = " "
|
||||||
|
|
||||||
#; Separator in between workspaces
|
#; Separator in between workspaces
|
||||||
# label-separator = |
|
#; label-separator = |
|
||||||
#
|
#
|
||||||
|
|
||||||
;[module/music]
|
;[module/music]
|
||||||
@ -124,27 +105,16 @@ ws-icon-default = " "
|
|||||||
|
|
||||||
[module/battery]
|
[module/battery]
|
||||||
type = internal/battery
|
type = internal/battery
|
||||||
battery = BAT1
|
battery = BAT0
|
||||||
adapter = ADP0
|
adapter = ADP0
|
||||||
format-charging = <label-charging>
|
format-charging = <ramp-capacity>
|
||||||
format-discharging = <ramp-capacity> <label-discharging>
|
format-discharging = <ramp-capacity>
|
||||||
label-discharging = %percentage%%
|
ramp-capacity-0 = ""
|
||||||
label-charging = %percentage%%
|
ramp-capacity-1 = ""
|
||||||
label-full = %percentage%%
|
ramp-capacity-2 = ""
|
||||||
# ramp-capacity-0 = ""
|
ramp-capacity-3 = ""
|
||||||
ramp-capacity-0 = ""
|
ramp-capacity-4 = ""
|
||||||
# ramp-capacity-1 = ""
|
|
||||||
ramp-capacity-1 = ""
|
|
||||||
# ramp-capacity-2 = ""
|
|
||||||
ramp-capacity-2 = ""
|
|
||||||
# ramp-capacity-3 = ""
|
|
||||||
ramp-capacity-3 = ""
|
|
||||||
# ramp-capacity-4 = ""
|
|
||||||
ramp-capacity-4 = ""
|
|
||||||
|
|
||||||
[module/backlight]
|
|
||||||
type = internal/backlight
|
|
||||||
format = <label>
|
|
||||||
[module/pulseaudio]
|
[module/pulseaudio]
|
||||||
type = internal/pulseaudio
|
type = internal/pulseaudio
|
||||||
|
|
||||||
@ -162,7 +132,7 @@ interval = 5
|
|||||||
; <label-volume> (default)
|
; <label-volume> (default)
|
||||||
; <ramp-volume>
|
; <ramp-volume>
|
||||||
; <bar-volume>
|
; <bar-volume>
|
||||||
format-volume = <ramp-volume> <label-volume>
|
format-volume = <label-volume>
|
||||||
; Available tags:
|
; Available tags:
|
||||||
; <label-muted> (default)
|
; <label-muted> (default)
|
||||||
; <ramp-volume>
|
; <ramp-volume>
|
||||||
@ -177,7 +147,7 @@ label-volume = %percentage%%
|
|||||||
; Available tokens:
|
; Available tokens:
|
||||||
; %percentage% (default)
|
; %percentage% (default)
|
||||||
; %decibels%
|
; %decibels%
|
||||||
label-muted = %percentage%%
|
label-muted = muted
|
||||||
|
|
||||||
; Only applies if <ramp-volume> is used
|
; Only applies if <ramp-volume> is used
|
||||||
ramp-volume-0 =
|
ramp-volume-0 =
|
||||||
@ -185,15 +155,14 @@ ramp-volume-1 =
|
|||||||
ramp-volume-2 =
|
ramp-volume-2 =
|
||||||
|
|
||||||
; Right and Middle click
|
; Right and Middle click
|
||||||
click-right = st -e pulsemixer
|
click-right = kitty -e pulsemixer
|
||||||
; click-middle =
|
; click-middle =
|
||||||
|
|
||||||
[module/network]
|
[module/network]
|
||||||
type = internal/network
|
type = internal/network
|
||||||
interface = wlan0
|
interface = enp4s0
|
||||||
label-disconnected = ""
|
label-disconnected = " Not connected"
|
||||||
label-connected = " %essid%:%local_ip%"
|
label-connected = ""
|
||||||
click-left = st -e iwctl
|
|
||||||
|
|
||||||
[module/redshift]
|
[module/redshift]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
@ -203,4 +172,4 @@ click-right = redshift -x
|
|||||||
|
|
||||||
[module/datetime]
|
[module/datetime]
|
||||||
type = internal/date
|
type = internal/date
|
||||||
date = %a %b %d %I:%M:%S %p
|
date = %a %b %d %I:%M %p
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
|
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
|
||||||
# Scheme name: Rosé Pine
|
# Scheme name: Gruvbox dark, hard
|
||||||
# Scheme author: Emilia Dunfelt <edun@dunfelt.se>
|
# Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
|
||||||
# Template author: theova
|
# Template author: theova
|
||||||
# Commentary: Tinted Theming: (https://github.com/tinted-theming)
|
# Commentary: Tinted Theming: (https://github.com/tinted-theming)
|
||||||
|
|
||||||
base00 = "#191724"
|
base00 = "#1d2021"
|
||||||
base01 = "#1f1d2e"
|
base01 = "#3c3836"
|
||||||
base02 = "#26233a"
|
base02 = "#504945"
|
||||||
base03 = "#6e6a86"
|
base03 = "#665c54"
|
||||||
base04 = "#908caa"
|
base04 = "#bdae93"
|
||||||
base05 = "#e0def4"
|
base05 = "#d5c4a1"
|
||||||
base06 = "#e0def4"
|
base06 = "#ebdbb2"
|
||||||
base07 = "#524f67"
|
base07 = "#fbf1c7"
|
||||||
base08 = "#eb6f92"
|
base08 = "#fb4934"
|
||||||
base09 = "#f6c177"
|
base09 = "#fe8019"
|
||||||
base0A = "#ebbcba"
|
base0A = "#fabd2f"
|
||||||
base0B = "#31748f"
|
base0B = "#b8bb26"
|
||||||
base0C = "#9ccfd8"
|
base0C = "#8ec07c"
|
||||||
base0D = "#c4a7e7"
|
base0D = "#83a598"
|
||||||
base0E = "#f6c177"
|
base0E = "#d3869b"
|
||||||
base0F = "#524f67"
|
base0F = "#d65d0e"
|
||||||
|
|
||||||
# set qutebrowser colors
|
# set qutebrowser colors
|
||||||
|
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Get class of a wid
|
|
||||||
get_class() {
|
|
||||||
id=$1
|
|
||||||
if [ -z "$id" ]; then
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
xprop -id "$id" | sed -n \
|
|
||||||
-e '/WM_CLASS/s/\( "\)/\n/g; s/[^\n]*\n\([^"]*\)[^\n]*/\1\n/g' \
|
|
||||||
-e '/WM_COMMAND/s/[^"]*/\n\n/1; s/\n"//1; s/\n\([^"]*\)".*/\n\1/; /\n/p' | sed '/^$/d' | head -n1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get_pid() {
|
|
||||||
xprop _NET_WM_PID -id "$1" | awk '/[0-9]+/ {print $3}'
|
|
||||||
}
|
|
||||||
|
|
||||||
get_ppid() {
|
|
||||||
ps -o ppid= -p $1
|
|
||||||
}
|
|
||||||
|
|
||||||
check_swallowing_process() {
|
|
||||||
pid=$(get_pid $1)
|
|
||||||
[ -z $pid ] && return 0
|
|
||||||
gppid=$(get_ppid $(get_ppid $pid))
|
|
||||||
grep -i "^$(ps -o cmd= -p $gppid | awk '{print $1}' | sed 's_^.*/__')$" ~/.config/bspwm/terminals && return 0
|
|
||||||
[ "$(get_ppid "$(get_ppid "$(get_pid "$1")")")" = "$(get_pid "$2")" ] && return 0 || return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
swallow() {
|
|
||||||
addedtodesktop=$2
|
|
||||||
lasttermdesktop=$(bspc query -D -n last)
|
|
||||||
|
|
||||||
swallowerid=$1
|
|
||||||
swallowingid=$(bspc query -N -n last)
|
|
||||||
if [ "$addedtodesktop" = "$lasttermdesktop" ] && check_swallowing_process "$swallowerid" "$swallowingid"; then
|
|
||||||
grep -q "^$(get_class "$swallowerid")$" ~/.config/bspwm/{noswallow, terminals} && return
|
|
||||||
grep -i "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
|
|
||||||
echo "$swallowerid $swallowingid" >> /tmp/swallowids
|
|
||||||
bspc node "$swallowingid" --flag hidden=on
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
spit() {
|
|
||||||
spitterid=$1
|
|
||||||
spitterdesktop=$2
|
|
||||||
grep "^$spitterid" /tmp/swallowids || return
|
|
||||||
spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
|
|
||||||
|
|
||||||
bspc node "$spittingid" --flag hidden=off
|
|
||||||
|
|
||||||
termdesktop=$(bspc query -D -n "$spittingid")
|
|
||||||
[ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
|
|
||||||
|
|
||||||
bspc node "$spittingid" -f
|
|
||||||
sed -i "/^$spitterid/d" /tmp/swallowids
|
|
||||||
}
|
|
||||||
|
|
||||||
bspc subscribe node_add node_remove | while read -r event
|
|
||||||
do
|
|
||||||
case $(echo "$event" | awk '{ print $1 }') in
|
|
||||||
node_add)
|
|
||||||
swallow $(echo "$event" | awk '{print $5 " " $3}')
|
|
||||||
;;
|
|
||||||
node_remove)
|
|
||||||
spit $(echo "$event" | awk '{print $4 " " $3}')
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
@ -1,82 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# A UI for detecting and selecting all displays. Probes xrandr for connected
|
|
||||||
# displays and lets user select one to use. User may also select "manual
|
|
||||||
# selection" which opens arandr.
|
|
||||||
|
|
||||||
twoscreen() { # If multi-monitor is selected and there are two screens.
|
|
||||||
|
|
||||||
mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
|
|
||||||
# Mirror displays using native resolution of external display and a scaled
|
|
||||||
# version for the internal display
|
|
||||||
if [ "$mirror" = "yes" ]; then
|
|
||||||
external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:")
|
|
||||||
internal=$(echo "$screens" | grep -v "$external")
|
|
||||||
|
|
||||||
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
|
|
||||||
tail -n 1 | awk '{print $1}')
|
|
||||||
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
|
|
||||||
tail -n 1 | awk '{print $1}')
|
|
||||||
|
|
||||||
res_ext_x=$(echo "$res_external" | sed 's/x.*//')
|
|
||||||
res_ext_y=$(echo "$res_external" | sed 's/.*x//')
|
|
||||||
res_int_x=$(echo "$res_internal" | sed 's/x.*//')
|
|
||||||
res_int_y=$(echo "$res_internal" | sed 's/.*x//')
|
|
||||||
|
|
||||||
scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
|
|
||||||
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
|
|
||||||
|
|
||||||
xrandr --output "$external" --auto --scale 1.0x1.0 \
|
|
||||||
--output "$internal" --auto --same-as "$external" \
|
|
||||||
--scale "$scale_x"x"$scale_y"
|
|
||||||
else
|
|
||||||
|
|
||||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
|
||||||
secondary=$(echo "$screens" | grep -v ^"$primary"$)
|
|
||||||
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
|
|
||||||
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
morescreen() { # If multi-monitor is selected and there are more than two screens.
|
|
||||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
|
||||||
secondary=$(echo "$screens" | grep -v ^"$primary"$ | dmenu -i -p "Select secondary display:")
|
|
||||||
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
|
|
||||||
tertiary=$(echo "$screens" | grep -v ^"$primary"$ | grep -v ^"$secondary"$ | dmenu -i -p "Select third display:")
|
|
||||||
xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto
|
|
||||||
}
|
|
||||||
|
|
||||||
multimon() { # Multi-monitor handler.
|
|
||||||
case "$(echo "$screens" | wc -l)" in
|
|
||||||
2) twoscreen ;;
|
|
||||||
*) morescreen ;;
|
|
||||||
esac ;}
|
|
||||||
|
|
||||||
onescreen() { # If only one output available or chosen.
|
|
||||||
xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -)
|
|
||||||
}
|
|
||||||
|
|
||||||
postrun() { # Stuff to run to clean up.
|
|
||||||
setbg # Fix background if screen size/arangement has changed.
|
|
||||||
{ killall dunst ; setsid -f dunst ;} >/dev/null 2>&1 # Restart dunst to ensure proper location on screen
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get all possible displays
|
|
||||||
allposs=$(xrandr -q | grep "connected")
|
|
||||||
|
|
||||||
# Get all connected screens.
|
|
||||||
screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
|
||||||
|
|
||||||
# If there's only one screen
|
|
||||||
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
|
|
||||||
{ onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;}
|
|
||||||
|
|
||||||
# Get user choice including multi-monitor and manual selection:
|
|
||||||
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
|
|
||||||
case "$chosen" in
|
|
||||||
"manual selection") arandr ; exit ;;
|
|
||||||
"multi-monitor") multimon ;;
|
|
||||||
*) onescreen "$chosen" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
postrun
|
|
@ -1,123 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Usage:
|
|
||||||
# `$0`: Ask for recording type via dmenu
|
|
||||||
# `$0 screencast`: Record both audio and screen
|
|
||||||
# `$0 video`: Record only screen
|
|
||||||
# `$0 audio`: Record only audio
|
|
||||||
# `$0 kill`: Kill existing recording
|
|
||||||
#
|
|
||||||
# If there is already a running instance, user will be prompted to end it.
|
|
||||||
|
|
||||||
getdim() { xrandr | grep -oP '(?<=current ).*(?=,)' | tr -d ' ' ;}
|
|
||||||
|
|
||||||
updateicon() { \
|
|
||||||
echo "$1" > /tmp/recordingicon
|
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
|
||||||
}
|
|
||||||
|
|
||||||
killrecording() {
|
|
||||||
recpid="$(cat /tmp/recordingpid)"
|
|
||||||
kill -15 "$recpid"
|
|
||||||
rm -f /tmp/recordingpid
|
|
||||||
updateicon ""
|
|
||||||
pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
|
|
||||||
}
|
|
||||||
|
|
||||||
screencast() { \
|
|
||||||
ffmpeg -y \
|
|
||||||
-f x11grab \
|
|
||||||
-framerate 30 \
|
|
||||||
-s "$(getdim)" \
|
|
||||||
-i "$DISPLAY" \
|
|
||||||
-r 24 \
|
|
||||||
-use_wallclock_as_timestamps 1 \
|
|
||||||
-f alsa -thread_queue_size 1024 -i default \
|
|
||||||
-c:v h264 \
|
|
||||||
-crf 0 -preset ultrafast -c:a aac \
|
|
||||||
"$HOME/Videos/Capture/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️🎙️"
|
|
||||||
}
|
|
||||||
|
|
||||||
video() { ffmpeg \
|
|
||||||
-f x11grab \
|
|
||||||
-framerate 30 \
|
|
||||||
-s "$(getdim)" \
|
|
||||||
-i "$DISPLAY" \
|
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
|
||||||
"$HOME/Videos/Capture/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️"
|
|
||||||
}
|
|
||||||
|
|
||||||
webcamhidef() { ffmpeg \
|
|
||||||
-f v4l2 \
|
|
||||||
-i /dev/video0 \
|
|
||||||
-video_size 1920x1080 \
|
|
||||||
"$HOME/Videos/Capture/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎥"
|
|
||||||
}
|
|
||||||
|
|
||||||
webcam() { ffmpeg \
|
|
||||||
-f v4l2 \
|
|
||||||
-i /dev/video0 \
|
|
||||||
-video_size 640x480 \
|
|
||||||
"$HOME/Videos/Capture/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎥"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
audio() { \
|
|
||||||
ffmpeg \
|
|
||||||
-f alsa -i default \
|
|
||||||
-c:a flac \
|
|
||||||
"$HOME/Videos/Capture/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "🎙️"
|
|
||||||
}
|
|
||||||
|
|
||||||
askrecording() { \
|
|
||||||
choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:")
|
|
||||||
case "$choice" in
|
|
||||||
screencast) screencast;;
|
|
||||||
audio) audio;;
|
|
||||||
video) video;;
|
|
||||||
*selected) videoselected;;
|
|
||||||
webcam) webcam;;
|
|
||||||
"webcam (hi-def)") webcamhidef;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
asktoend() { \
|
|
||||||
response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
|
|
||||||
[ "$response" = "Yes" ] && killrecording
|
|
||||||
}
|
|
||||||
|
|
||||||
videoselected()
|
|
||||||
{
|
|
||||||
slop -f "%x %y %w %h" > /tmp/slop
|
|
||||||
read -r X Y W H < /tmp/slop
|
|
||||||
rm /tmp/slop
|
|
||||||
|
|
||||||
ffmpeg \
|
|
||||||
-f x11grab \
|
|
||||||
-framerate 30 \
|
|
||||||
-video_size "$W"x"$H" \
|
|
||||||
-i :0.0+"$X,$Y" \
|
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
|
||||||
"$HOME/Videos/Capture/box-$(date '+%y%m%d-%H%M-%S').mkv" &
|
|
||||||
echo $! > /tmp/recordingpid
|
|
||||||
updateicon "⏺️"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
screencast) screencast;;
|
|
||||||
audio) audio;;
|
|
||||||
video) video;;
|
|
||||||
*selected) videoselected;;
|
|
||||||
kill) killrecording;;
|
|
||||||
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
|
|
||||||
esac
|
|
@ -1,119 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Mounts Android Phones and USB drives (encrypted or not). This script will
|
|
||||||
# replace the older `dmenumount` which had extra steps and couldn't handle
|
|
||||||
# encrypted drives.
|
|
||||||
# TODO: Try decrypt for drives in crtypttab
|
|
||||||
# TODO: Add some support for connecting iPhones (although they are annoying).
|
|
||||||
|
|
||||||
IFS='
|
|
||||||
'
|
|
||||||
# Function for escaping cell-phone names.
|
|
||||||
escape(){ echo "$@" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g" ;}
|
|
||||||
|
|
||||||
# Check for phones.
|
|
||||||
phones="$(simple-mtpfs -l 2>/dev/null | sed "s/^/📱/")"
|
|
||||||
mountedphones="$(grep "simple-mtpfs" /etc/mtab)"
|
|
||||||
# If there are already mounted phones, remove them from the list of mountables.
|
|
||||||
[ -n "$mountedphones" ] && phones="$(for phone in $phones; do
|
|
||||||
for mounted in $mountedphones; do
|
|
||||||
escphone="$(escape "$phone")"
|
|
||||||
[[ "$mounted" =~ "$escphone" ]] && break 1
|
|
||||||
done && continue 1
|
|
||||||
echo "$phone"
|
|
||||||
done)"
|
|
||||||
|
|
||||||
# Check for drives.
|
|
||||||
lsblkoutput="$(lsblk -rpo "uuid,name,type,size,label,mountpoint,fstype")"
|
|
||||||
# Get all LUKS drives
|
|
||||||
allluks="$(echo "$lsblkoutput" | grep crypto_LUKS)"
|
|
||||||
# Get a list of the LUKS drive UUIDs already decrypted.
|
|
||||||
decrypted="$(find /dev/disk/by-id/dm-uuid-CRYPT-LUKS2-* | sed "s|.*LUKS2-||;s|-.*||")"
|
|
||||||
# Functioning for formatting drives correctly for dmenu:
|
|
||||||
filter() { sed "s/ /:/g" | awk -F':' '$7==""{printf "%s%s (%s) %s\n",$1,$3,$5,$6}' ; }
|
|
||||||
|
|
||||||
# Get only LUKS drives that are not decrypted.
|
|
||||||
unopenedluks="$(for drive in $allluks; do
|
|
||||||
uuid="${drive%% *}"
|
|
||||||
uuid="${uuid//-}" # This is a bashism.
|
|
||||||
[ -n "$decrypted" ] && for open in $decrypted; do
|
|
||||||
[ "$uuid" = "$open" ] && break 1
|
|
||||||
done && continue 1
|
|
||||||
echo "🔒 $drive"
|
|
||||||
done | filter)"
|
|
||||||
|
|
||||||
# Get all normal, non-encrypted or decrypted partitions that are not mounted.
|
|
||||||
normalparts="$(echo "$lsblkoutput"| grep -v crypto_LUKS | grep 'part\|rom\|crypt' | sed "s/^/💾 /" | filter )"
|
|
||||||
|
|
||||||
# Add all to one variable. If no mountable drives found, exit.
|
|
||||||
alldrives="$(echo "$phones
|
|
||||||
$unopenedluks
|
|
||||||
$normalparts" | sed "/^$/d;s/ *$//")"
|
|
||||||
|
|
||||||
# Quit the script if a sequential command fails.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
test -n "$alldrives"
|
|
||||||
|
|
||||||
# Feed all found drives to dmenu and get user choice.
|
|
||||||
chosen="$(echo "$alldrives" | dmenu -p "Mount which drive?" -i)"
|
|
||||||
|
|
||||||
# Function for prompting user for a mountpoint.
|
|
||||||
getmount(){
|
|
||||||
mp="$(find /mnt /media /mount /home -maxdepth 1 -type d 2>/dev/null | dmenu -i -p "Mount this drive where?")"
|
|
||||||
test -n "$mp"
|
|
||||||
if [ ! -d "$mp" ]; then
|
|
||||||
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?")
|
|
||||||
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
attemptmount(){
|
|
||||||
# Attempt to mount without a mountpoint, to see if drive is in fstab.
|
|
||||||
sudo -A mount "$chosen" || return 1
|
|
||||||
notify-send "💾Drive Mounted." "$chosen mounted."
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$chosen" in
|
|
||||||
💾*)
|
|
||||||
chosen="${chosen%% *}"
|
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
|
||||||
parttype="$(echo "$lsblkoutput" | grep "$chosen")"
|
|
||||||
attemptmount || getmount
|
|
||||||
case "${parttype##* }" in
|
|
||||||
vfat) sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;;
|
|
||||||
btrfs) sudo -A mount "$chosen" "$mp" ;;
|
|
||||||
*) sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;;
|
|
||||||
esac
|
|
||||||
notify-send "💾Drive Mounted." "$chosen mounted to $mp."
|
|
||||||
;;
|
|
||||||
|
|
||||||
🔒*)
|
|
||||||
chosen="${chosen%% *}"
|
|
||||||
chosen="${chosen:1}" # This is a bashism.
|
|
||||||
# Number the drive.
|
|
||||||
while true; do
|
|
||||||
[ -f "/dev/mapper/usb$num" ] || break
|
|
||||||
num="$(printf "%02d" "$((num +1))")"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Decrypt in a terminal window
|
|
||||||
${TERMINAL:-st} -n floatterm -g 60x1 -e sudo cryptsetup open "$chosen" "usb$num"
|
|
||||||
# Check if now decrypted.
|
|
||||||
test -b "/dev/mapper/usb$num"
|
|
||||||
|
|
||||||
attemptmount || getmount
|
|
||||||
sudo -A mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)"
|
|
||||||
notify-send "🔓Decrypted drive Mounted." "$chosen decrypted and mounted to $mp."
|
|
||||||
;;
|
|
||||||
|
|
||||||
📱*)
|
|
||||||
notify-send "❗Note" "Remember to allow file access on your phone now."
|
|
||||||
getmount
|
|
||||||
number="${chosen%%:*}"
|
|
||||||
number="${chosen:1}" # This is a bashism.
|
|
||||||
sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp"
|
|
||||||
notify-send "🤖 Android Mounted." "Android device mounted to $mp."
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Unmount USB drives or Android phones. Replaces the older `dmenuumount`. Fewer
|
|
||||||
# prompt and also de-decrypts LUKS drives that are unmounted.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
mounteddroids="$(grep simple-mtpfs /etc/mtab | awk '{print "📱" $2}')"
|
|
||||||
lsblkoutput="$(lsblk -nrpo "name,type,size,mountpoint")"
|
|
||||||
mounteddrives="$(echo "$lsblkoutput" | awk '($2=="part"||$2="crypt")&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "💾%s (%s)\n",$4,$3}')"
|
|
||||||
|
|
||||||
allunmountable="$(echo "$mounteddroids
|
|
||||||
$mounteddrives" | sed "/^$/d;s/ *$//")"
|
|
||||||
test -n "$allunmountable"
|
|
||||||
|
|
||||||
chosen="$(echo "$allunmountable" | dmenu -i -p "Unmount which drive?")"
|
|
||||||
chosen="${chosen%% *}"
|
|
||||||
test -n "$chosen"
|
|
||||||
|
|
||||||
sudo -A umount -l "/${chosen#*/}"
|
|
||||||
notify-send "Device unmounted." "$chosen has been unmounted."
|
|
||||||
|
|
||||||
# Close the chosen drive if decrypted.
|
|
||||||
cryptid="$(echo "$lsblkoutput" | grep "/${chosen#*/}$")"
|
|
||||||
cryptid="${cryptid%% *}"
|
|
||||||
test -b /dev/mapper/"${cryptid##*/}"
|
|
||||||
sudo -A cryptsetup close "$cryptid"
|
|
||||||
notify-send "🔒Device dencryption closed." "Drive is now securely locked again."
|
|
@ -1,22 +1,22 @@
|
|||||||
! base16 Rosé Pine
|
! base16 Gruvbox dark, hard
|
||||||
! Scheme author: Emilia Dunfelt <edun@dunfelt.se>
|
! Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
|
||||||
! Template author: Tinted Theming (https://github.com/tinted-theming)
|
! Template author: Tinted Theming (https://github.com/tinted-theming)
|
||||||
|
|
||||||
#define base00 #191724
|
#define base00 #1d2021
|
||||||
#define base01 #1f1d2e
|
#define base01 #3c3836
|
||||||
#define base02 #26233a
|
#define base02 #504945
|
||||||
#define base04 #908caa
|
#define base04 #bdae93
|
||||||
#define base05 #e0def4
|
#define base05 #d5c4a1
|
||||||
#define base06 #e0def4
|
#define base06 #ebdbb2
|
||||||
#define base07 #524f67
|
#define base07 #fbf1c7
|
||||||
#define base08 #eb6f92
|
#define base08 #fb4934
|
||||||
#define base09 #f6c177
|
#define base09 #fe8019
|
||||||
#define base0A #ebbcba
|
#define base0A #fabd2f
|
||||||
#define base0B #31748f
|
#define base0B #b8bb26
|
||||||
#define base0C #9ccfd8
|
#define base0C #8ec07c
|
||||||
#define base0D #c4a7e7
|
#define base0D #83a598
|
||||||
#define base0E #f6c177
|
#define base0E #d3869b
|
||||||
#define base0F #524f67
|
#define base0F #d65d0e
|
||||||
|
|
||||||
*foreground: base05
|
*foreground: base05
|
||||||
#ifdef background_opacity
|
#ifdef background_opacity
|
||||||
|
Loading…
Reference in New Issue
Block a user