1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2025-06-15 18:34:15 +03:00

Compare commits

..

10 Commits

7 changed files with 43 additions and 13 deletions

View File

@ -11,22 +11,26 @@ fi
function show_help {
cat <<-EOF
Usage: $0 -h | -n NAME [-s SUITE] [-d]
Usage: $0 -h | -n NAME [-s SUITE] [-t [SNAPSHOT_NAME] -r] [-d]
Create a nspanw container called NAME
-h help
-n container name
-s debian suite (default: ${DEFAULT_SUITE})
-t snapshot container
-r rollback to snapshot
-d delete container
EOF
}
while getopts 'hn:s:d' flag; do
while getopts 'hn:s:t:rd' flag; do
case "${flag}" in
h) show_help; exit 0;;
n) name="${OPTARG}" ;;
s) suite="${OPTARG}" ;;
t) snapshot="${OPTARG}" ;;
r) rollback=1 ;;
d) delete=1 ;;
*) echo "Unexpected option ${flag}" ;;
esac
@ -43,9 +47,26 @@ else
echo "Container name is $name and suite is ${SUITE}"
fi
if [[ -n ${snapshot:-} ]]; then
dest_snapshot_name="${BASE}/.${name}_${snapshot}"
if [[ -n ${rollback:-} ]]; then
if [[ -d ${dest_snapshot_name} ]]; then
btrfs subvolume delete "${BASE}/${name}"
btrfs subvolume snapshot "${dest_snapshot_name}" "${BASE}/${name}"
exit 0
else
echo "Can't rollback as '${snapshot}' does not exist"
exit 1
fi
else
btrfs subvolume snapshot -r "${BASE}/${name}" "${dest_snapshot_name}"
exit 0
fi
fi
if [[ -n ${delete:-} ]]; then
btrfs subvolume delete "${BASE}/$name"
exit 0
btrfs subvolume delete "${BASE}/${name}" "${BASE}/.${name}_"*
exit 0
fi
btrfs subvolume create "${BASE}/${name}"
@ -105,9 +126,11 @@ apt install --yes --no-install-recommends neovim
update-alternatives --set editor /usr/bin/nvim
ln -sf /usr/share/nvim/runtime/macros/less.sh /usr/local/bin/vless
# Use systemd-resovled directly by configuring /etc/nsswitch.conf
apt install --yes --no-install-recommends libnss-resolve
systemctl enable systemd-networkd
# systemd-resolved package also replaces /etc/resolv.conf with a symlink that breaks DNS in our current pre setup environment
apt install --yes --no-install-recommends libnss-resolve
# Needed by libnss-resolve config in /etc/nsswitch.conf
systemctl enable systemd-resolved
EOF

3
.bin/no-sleep Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
systemd-inhibit --what=sleep:idle --mode=block bash -c 'while true; do sleep 1; done'

View File

@ -42,7 +42,7 @@ else:
sys.exit(0)
elif sys.argv[1] == '--region':
run(["dulcepan", "-C", "-o", file_name], check=True)
run(["dulcepan", "-o", file_name], check=True)
elif sys.argv[1] == '--window':
tree = run(['swaymsg', '-t', 'get_tree'], check=True, capture_output=True)

View File

@ -21,7 +21,3 @@ exec systemd-run --user --unit=slack-flatpak /usr/bin/flatpak run com.slack.Slac
for_window [app_id="telegramdesktop"] move to workspace $chat_workspace
for_window [app_id="org.telegram.desktop"] move to workspace $chat_workspace
exec systemd-run --user --unit=telegram /usr/bin/env XDG_CURRENT_DESKTOP=GNOME telegram-desktop
for_window [class="drata-agent"] move absolute position 2160 px 0 px
for_window [app_id="drata-agent"] move absolute position 2160 px 0 px
exec systemd-run --user --unit=drata-agent /usr/bin/drata-agent

View File

@ -1,4 +1,5 @@
# Work computer
exec /usr/bin/swaynag-battery --threshold 5
set $left_disp "Dell Inc. DELL U2724DE C9YPBP3"
set $right_disp "Dell Inc. DELL U2724D J3XFCP3"
@ -15,7 +16,7 @@ output $left_disp mode 2560x1440@120.000Hz
output $right_disp pos 2560 0
output $right_disp mode 2560x1440@120.000Hz
set $laptop "LG Display 0x06ED Unknown"
set $laptop eDP-1
bindswitch lid:on output $laptop disable
bindswitch lid:off output $laptop enable

View File

@ -5,5 +5,10 @@ exec /usr/bin/swaynag-battery --threshold 5
#set $right_disp "Unknown 0x0791 0x00000000"
set $chat_workspace 10
set $laptop eDP-1
bindswitch lid:on output $laptop disable
bindswitch lid:off output $laptop enable
output $left_disp pos 0 0
output $right_disp pos 370 1440

4
.zshrc
View File

@ -319,6 +319,8 @@ function ssh {
# i don't like that systemd by default uses a pager
export SYSTEMD_PAGER=''
# Minio CLI is also stupid
export MC_DISABLE_PAGER=1
# set man max width
export MANWIDTH=80
@ -333,7 +335,7 @@ fi
# https://neovim.io/doc/user/various.html#less
function vless {
/usr/share/nvim/runtime/macros/less.sh $@
/usr/share/nvim/runtime/scripts/less.sh $@
}
# If running under windows with pageagent then use it