i3-resurrect etc.
This commit is contained in:
parent
ce8a4809b1
commit
3648f00fb5
|
|
@ -0,0 +1,60 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
bluetooth_print() {
|
||||||
|
bluetoothctl | while read -r; do
|
||||||
|
if [ "$(systemctl is-active "bluetooth.service")" = "active" ]; then
|
||||||
|
printf '#1'
|
||||||
|
|
||||||
|
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2)
|
||||||
|
counter=0
|
||||||
|
|
||||||
|
echo "$devices_paired" | while read -r line; do
|
||||||
|
device_info=$(bluetoothctl info "$line")
|
||||||
|
|
||||||
|
if echo "$device_info" | grep -q "Connected: yes"; then
|
||||||
|
device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-)
|
||||||
|
|
||||||
|
if [ $counter -gt 0 ]; then
|
||||||
|
printf ", %s" "$device_alias"
|
||||||
|
else
|
||||||
|
printf " %s" "$device_alias"
|
||||||
|
fi
|
||||||
|
|
||||||
|
counter=$((counter + 1))
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '\n'
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "#2"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
bluetooth_toggle() {
|
||||||
|
if bluetoothctl show | grep -q "Powered: no"; then
|
||||||
|
bluetoothctl power on >> /dev/null
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2)
|
||||||
|
echo "$devices_paired" | while read -r line; do
|
||||||
|
bluetoothctl connect "$line" >> /dev/null
|
||||||
|
done
|
||||||
|
else
|
||||||
|
devices_paired=$(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2)
|
||||||
|
echo "$devices_paired" | while read -r line; do
|
||||||
|
bluetoothctl disconnect "$line" >> /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
bluetoothctl power off >> /dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--toggle)
|
||||||
|
bluetooth_toggle
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
bluetooth_print
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
# i3-resurrect-restore-all]
|
||||||
|
# restoring all available saved workspaces
|
||||||
|
# arguments: No arguments. Assumes .i3 it places at ~/
|
||||||
|
# expected input/output - sample input -> output ( a few lines)
|
||||||
|
# example suggested usage: myscript filename > bigoutputfile
|
||||||
|
|
||||||
|
#save current workspace
|
||||||
|
cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.visible == true) | .name')
|
||||||
|
|
||||||
|
# extract workspace name which is defined between two underscored
|
||||||
|
workspaces=$(ls -l ~/.i3/i3-resurrect/*.json | grep -Po '.*_\K(.*)_' | sed 's/_//' | uniq)
|
||||||
|
echo "Found workspaces: $workspaces"
|
||||||
|
|
||||||
|
# restore workspaces
|
||||||
|
for ws in ${workspaces[*]}; do
|
||||||
|
echo "restoring $ws"
|
||||||
|
i3-resurrect restore -w $ws
|
||||||
|
done
|
||||||
|
|
||||||
|
notify-send "i3-resurrect" "Restored all workspaces"
|
||||||
|
i3-msg workspace $cur_workspace
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
# i3-resurrect-save-all
|
||||||
|
# this program saves all currently active workspaces with i3-resurrect -
|
||||||
|
# arguments: take no arguments and assumes .i3/i3-resurrect is at "~/"
|
||||||
|
# expected output: showin what workspace is currently being saved and sends a notification when done
|
||||||
|
# example suggested usage: i3-resurrect-save-all
|
||||||
|
|
||||||
|
# remove old saves
|
||||||
|
rm -f ~/.i3/i3-resurrect/*
|
||||||
|
|
||||||
|
# find running workspaces
|
||||||
|
workspaces=$(i3-msg -t get_workspaces | jq '.[] | .name')
|
||||||
|
echo "Found workspaces: $workspaces"
|
||||||
|
|
||||||
|
# Save workspaces with programs running
|
||||||
|
for ws in ${workspaces[*]}; do
|
||||||
|
# remove quotes from output
|
||||||
|
temp="${ws%\"}"
|
||||||
|
temp="${temp#\"}"
|
||||||
|
echo "saving $temp"
|
||||||
|
i3-resurrect save -w $temp
|
||||||
|
done
|
||||||
|
|
||||||
|
notify-send "i3-resurrect" "Saved all workspaces"
|
||||||
|
|
@ -238,7 +238,8 @@ unredir-if-possible = true;
|
||||||
|
|
||||||
# get rid of the screen tearing in full screen Chrome
|
# get rid of the screen tearing in full screen Chrome
|
||||||
unredir-if-possible-exclude = [
|
unredir-if-possible-exclude = [
|
||||||
"name *= 'Chrome'"
|
"name *= 'Chrome'",
|
||||||
|
"name *= 'Chromium'"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Specify a list of conditions of windows that should always be considered focused.
|
# Specify a list of conditions of windows that should always be considered focused.
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,11 @@ bindsym $mod+Shift+c sticky toggle
|
||||||
|
|
||||||
######### COLORS ##########
|
######### COLORS ##########
|
||||||
# BORDER BACKGROUND TEXT INDICATOR CHILD_BORDER
|
# BORDER BACKGROUND TEXT INDICATOR CHILD_BORDER
|
||||||
client.focused #636E90 #9797B2 #020203 #636E90 #778AAD
|
client.focused #494C53 #6B6D73 #03060D #494C53 #5E6168
|
||||||
client.unfocused #778AAD #636E90 #e2cedb #778AAD #020203
|
client.unfocused #5E6168 #494C53 #bfc0c2 #5E6168 #03060D
|
||||||
client.focused_inactive #020203 #9e9099 #e2cedb #778AAD #020203
|
client.focused_inactive #03060D #858687 #bfc0c2 #5E6168 #03060D
|
||||||
client.urgent #8C7281 #8C7281 #020203 #8C7281 #8C7281
|
client.urgent #595C63 #595C63 #03060D #595C63 #595C63
|
||||||
client.background #9e9099
|
client.background #858687
|
||||||
|
|
||||||
###---Starting External Scripts---###
|
###---Starting External Scripts---###
|
||||||
|
|
||||||
|
|
@ -127,6 +127,10 @@ bindsym $mod+Shift+b move scratchpad
|
||||||
# Show the first scratchpad window
|
# Show the first scratchpad window
|
||||||
bindsym $mod+Shift+e scratchpad show
|
bindsym $mod+Shift+e scratchpad show
|
||||||
|
|
||||||
|
# i3-resurrect save/restore
|
||||||
|
bindsym Mod1+Shift+s exec ~/.config/Scripts/i3-resurrect-save-all
|
||||||
|
bindsym Mod1+Shift+r exec ~/.config/Scripts/i3-resurrect-restore-all
|
||||||
|
|
||||||
#Composite manager:
|
#Composite manager:
|
||||||
bindsym $mod+b exec --no-startup-id pkill compton
|
bindsym $mod+b exec --no-startup-id pkill compton
|
||||||
bindsym $mod+Ctrl+b exec --no-startup-id compton -b -f
|
bindsym $mod+Ctrl+b exec --no-startup-id compton -b -f
|
||||||
|
|
@ -193,7 +197,7 @@ bindsym $mod+s gaps inner current plus 5
|
||||||
bindsym $mod+Shift+s gaps inner current minus 5
|
bindsym $mod+Shift+s gaps inner current minus 5
|
||||||
|
|
||||||
#bindsym $mod+d exec rofi -config ~/.config/rofi/config -show drun
|
#bindsym $mod+d exec rofi -config ~/.config/rofi/config -show drun
|
||||||
bindsym $mod+d exec dmenu_run -fn 'Ubuntu Mono derivative Powerline-18' -h '35' -nb '#E1A0BA' -sf '#020203' -sb '#8C7281' -nf '#e2cedb'
|
bindsym $mod+d exec dmenu_run -fn 'Ubuntu Mono derivative Powerline-18' -h '35' -nb '#7A7C82' -sf '#03060D' -sb '#595C63' -nf '#bfc0c2'
|
||||||
bindsym Mod1+d exec ~/.config/Scripts/rofi-bangs.sh
|
bindsym Mod1+d exec ~/.config/Scripts/rofi-bangs.sh
|
||||||
|
|
||||||
bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0
|
bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,21 @@
|
||||||
;
|
;
|
||||||
[colors]
|
[colors]
|
||||||
background = #00000000
|
background = #00000000
|
||||||
background-alt = #636E90
|
background-alt = #494C53
|
||||||
foreground = #778AAD
|
foreground = #5E6168
|
||||||
foreground-alt = #9FA7CA
|
foreground-alt = #7E8187
|
||||||
highlight = #e2cedb
|
highlight = #bfc0c2
|
||||||
error = #8C7281
|
error = #595C63
|
||||||
red = #8C7281
|
red = #595C63
|
||||||
yellow = #9797B2
|
yellow = #6B6D73
|
||||||
green = #E1A0BA
|
green = #7A7C82
|
||||||
darkblue = #778AAD
|
darkblue = #5E6168
|
||||||
alert = #FF0000
|
alert = #FF0000
|
||||||
lightblue = #e2cedb
|
lightblue = #bfc0c2
|
||||||
orange = #9FA7CA
|
orange = #7E8187
|
||||||
blue = #636E90
|
blue = #494C53
|
||||||
black = #020203
|
black = #03060D
|
||||||
grey = #9e9099
|
grey = #858687
|
||||||
|
|
||||||
[bar/top]
|
[bar/top]
|
||||||
monitor = ${env:MONITOR:eDP-1}
|
monitor = ${env:MONITOR:eDP-1}
|
||||||
|
|
@ -38,7 +38,7 @@ monitor = ${env:MONITOR:eDP-1}
|
||||||
include-file = ~/.config/polybar/bottom-bar
|
include-file = ~/.config/polybar/bottom-bar
|
||||||
modules-left = hostname arrowb01
|
modules-left = hostname arrowb01
|
||||||
modules-center = cpu memory temperature filesystem
|
modules-center = cpu memory temperature filesystem
|
||||||
modules-right = arrowb1 openweather
|
modules-right = arrowb2 bluetoothctl arrowb1 openweather
|
||||||
|
|
||||||
[module/arrowb01]
|
[module/arrowb01]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
|
|
@ -50,6 +50,12 @@ content-background = #00000000
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content = ""
|
content = ""
|
||||||
content-foreground = ${colors.green}
|
content-foreground = ${colors.green}
|
||||||
|
content-background = ${colors.orange}
|
||||||
|
|
||||||
|
[module/arrowb2]
|
||||||
|
type = custom/text
|
||||||
|
content = ""
|
||||||
|
content-foreground = ${colors.orange}
|
||||||
content-background = #00000000
|
content-background = #00000000
|
||||||
|
|
||||||
[module/arrow01]
|
[module/arrow01]
|
||||||
|
|
@ -119,6 +125,15 @@ content = ""
|
||||||
content-foreground = ${colors.darkblue}
|
content-foreground = ${colors.darkblue}
|
||||||
content-background = #00000000
|
content-background = #00000000
|
||||||
|
|
||||||
|
[module/bluetoothctl]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/Scripts/bluetoothctl.sh
|
||||||
|
tail = true
|
||||||
|
click-left = ~/.config/Scripts/bluetoothctl.sh --toggle
|
||||||
|
label = " %output% "
|
||||||
|
label-foreground = ${colors.black}
|
||||||
|
label-background = ${colors.orange}
|
||||||
|
|
||||||
[module/expressvpn-status]
|
[module/expressvpn-status]
|
||||||
type = custom/script
|
type = custom/script
|
||||||
exec = ~/.config/Scripts/expressvpn-status.sh
|
exec = ~/.config/Scripts/expressvpn-status.sh
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ monitor = ${{env:MONITOR:eDP-1}}
|
||||||
include-file = ~/.config/polybar/bottom-bar
|
include-file = ~/.config/polybar/bottom-bar
|
||||||
modules-left = hostname arrowb01
|
modules-left = hostname arrowb01
|
||||||
modules-center = cpu memory temperature filesystem
|
modules-center = cpu memory temperature filesystem
|
||||||
modules-right = arrowb1 openweather
|
modules-right = arrowb2 bluetoothctl arrowb1 openweather
|
||||||
|
|
||||||
[module/arrowb01]
|
[module/arrowb01]
|
||||||
type = custom/text
|
type = custom/text
|
||||||
|
|
@ -50,6 +50,12 @@ content-background = #00000000
|
||||||
type = custom/text
|
type = custom/text
|
||||||
content = ""
|
content = ""
|
||||||
content-foreground = ${{colors.green}}
|
content-foreground = ${{colors.green}}
|
||||||
|
content-background = ${{colors.orange}}
|
||||||
|
|
||||||
|
[module/arrowb2]
|
||||||
|
type = custom/text
|
||||||
|
content = ""
|
||||||
|
content-foreground = ${{colors.orange}}
|
||||||
content-background = #00000000
|
content-background = #00000000
|
||||||
|
|
||||||
[module/arrow01]
|
[module/arrow01]
|
||||||
|
|
@ -119,6 +125,15 @@ content = ""
|
||||||
content-foreground = ${{colors.darkblue}}
|
content-foreground = ${{colors.darkblue}}
|
||||||
content-background = #00000000
|
content-background = #00000000
|
||||||
|
|
||||||
|
[module/bluetoothctl]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/Scripts/bluetoothctl.sh
|
||||||
|
tail = true
|
||||||
|
click-left = ~/.config/Scripts/bluetoothctl.sh --toggle
|
||||||
|
label = " %output% "
|
||||||
|
label-foreground = ${{colors.black}}
|
||||||
|
label-background = ${{colors.orange}}
|
||||||
|
|
||||||
[module/expressvpn-status]
|
[module/expressvpn-status]
|
||||||
type = custom/script
|
type = custom/script
|
||||||
exec = ~/.config/Scripts/expressvpn-status.sh
|
exec = ~/.config/Scripts/expressvpn-status.sh
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue