diff options
author | Joe <rrbo@proton.me> | 2023-01-31 15:26:57 +0100 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-01-31 15:26:57 +0100 |
commit | 22ba7c46f959d7ceba975e002af71378227c8b9b (patch) | |
tree | ec2ca63e241419f7c196dcf8d88e2402be3b9b46 | |
parent | up (diff) | |
download | dotfiles-bsd-22ba7c46f959d7ceba975e002af71378227c8b9b.tar.gz dotfiles-bsd-22ba7c46f959d7ceba975e002af71378227c8b9b.tar.bz2 dotfiles-bsd-22ba7c46f959d7ceba975e002af71378227c8b9b.tar.xz dotfiles-bsd-22ba7c46f959d7ceba975e002af71378227c8b9b.tar.zst dotfiles-bsd-22ba7c46f959d7ceba975e002af71378227c8b9b.zip |
up
-rw-r--r-- | .config/alacritty/alacritty.yml | 2 | ||||
-rw-r--r-- | .config/emacs/org/config.org | 2 | ||||
-rw-r--r-- | .config/gtk-3.0/bookmarks | 2 | ||||
-rwxr-xr-x | .config/openbox/menu.xml | 8 | ||||
-rwxr-xr-x | .local/bin/powercmd | 52 |
5 files changed, 52 insertions, 14 deletions
diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index 1e647af..e668630 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -107,7 +107,7 @@ font: # family: DejaVuSansMono Nerd Font # family: mononoki Nerd Font # family: UbuntuMono Nerd Font - family: TerminessTTF Nerd Font + family: 3270 Nerd Font Mono # The `style` can be specified to pick a specific face. style: Regular diff --git a/.config/emacs/org/config.org b/.config/emacs/org/config.org index 2915ea0..c77cfdf 100644 --- a/.config/emacs/org/config.org +++ b/.config/emacs/org/config.org @@ -18,7 +18,7 @@ (horizontal-scroll-bars . nil)))) (add-hook 'after-make-frame-functions 'my/disable-scroll-bars) - (setq default-frame-alist '((font . "mononoki Nerd Font:pixelsize=15"))) + (setq default-frame-alist '((font . "mononoki Nerd Font:pixelsize=17"))) ;; (set-frame-font "mononoki Nerd Font:pixelsize=15" nil t) (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'text-mode-hook 'display-line-numbers-mode) diff --git a/.config/gtk-3.0/bookmarks b/.config/gtk-3.0/bookmarks index 0dd9103..aa4513e 100644 --- a/.config/gtk-3.0/bookmarks +++ b/.config/gtk-3.0/bookmarks @@ -1,3 +1 @@ file:///tmp tmp -file:///home/jozan/pics/profile profile -file:///home/jozan/pics/scrot scrot diff --git a/.config/openbox/menu.xml b/.config/openbox/menu.xml index 02e7c88..df12c5e 100755 --- a/.config/openbox/menu.xml +++ b/.config/openbox/menu.xml @@ -148,12 +148,12 @@ </item> <item label="Lock screen"> <action name="Execute"> - <command>xscreensaver-command -lock</command> + <command>~/.local/bin/powercmd lock</command> </action> </item> <item label="Sleep"> <action name="Execute"> - <command>sh -c "notify-send -u normal reboot \" G'night, partner!\"; sleep 2; acpiconf -s 3"</command> + <command>~/.local/bin/powercmd sleep</command> </action> </item> <item label="Log Out"> @@ -163,12 +163,12 @@ </item> <item label="Reboot"> <action name="Execute"> - <command>sh -c "emacsclient -e '\"(save-buffers-kill-emacs)\"'; notify-send -u normal reboot \" Rebootin' now!\"; sleep 2; systemctl reboot</command> + <command>~/.local/bin/powercmd reboot</command> </action> </item> <item label="Shutdown"> <action name="Execute"> - <command>sh -c "emacsclient -e '\"(save-buffers-kill-emacs)\"'; notify-send -u normal shutdown ' Farewell, partner!'; sleep 2; systemctl poweroff</command> + <command>~/.local/bin/powercmd poweroff</command> </action> </item> </menu> diff --git a/.local/bin/powercmd b/.local/bin/powercmd index fadf6a0..7cb2ead 100755 --- a/.local/bin/powercmd +++ b/.local/bin/powercmd @@ -1,12 +1,13 @@ #!/bin/sh -# [ -z "$1" ] && echo "no arg" && exit 1 +[ -z "$1" ] && echo "no arg" && exit 1 os="$(uname)" -if [ $os -eq "Linux" ]; then +if [ "$os" = "Linux" ]; then grep "Artix" /etc/issue >/dev/null 2>&1 && os=1 || os=2 -elif [ $os -eq "FreeBSD" ]; then +elif [ "$os" = "FreeBSD" ]; then + os=3 else echo "unknown OS" exit 1 @@ -17,7 +18,46 @@ fi # 3: FreeBSD case $os in - 1) icon="" ;; - 2) icon="" ;; - 3) icon="" ;; + 1) icon=" " ;; + 2) icon=" " ;; + 3) icon=" " ;; +esac + +case $1 in + "lock") xscreensaver-command -lock ;; + "sleep") + notify-send -u normal "sleep" "$icon G'night, partner!" + sleep 1 + xscreensaver-command -lock + sleep 5 + case $os in + 1) loginctl hibernate ;; + 2) systemctl hibernate ;; + 3) acpiconf -s 4 ;; + esac + ;; + "reboot") + emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1 + notify-send -u normal reboot "$icon Rebootin' now!" + sleep 2 + case $os in + 1) loginctl reboot ;; + 2) systemctl reboot ;; + 3) shutdown -r now ;; + esac + ;; + "poweroff") + emacsclient -e '"(save-buffers-kill-emacs)"' >/dev/null 2>&1 + notify-send -u normal poweroff "$icon Farewell, partner!" + sleep 2 + case $os in + 1) loginctl poweroff ;; + 2) systemctl poweroff ;; + 3) shutdown -p now ;; + esac + ;; + *) + echo "wrong arg" + exit 1 + ;; esac |