From da985aeb0cb50eaa66c3679be8a646e84947b2fa Mon Sep 17 00:00:00 2001 From: Mattia Cabrini Date: Sat, 1 Feb 2025 18:24:15 +0100 Subject: [PATCH] Bash battery scripts & TMUX small config --- .bash_aliases | 14 +++++++++----- .config/bash/utils/battery_pc.sh | 1 + .config/bash/utils/battery_uc.sh | 7 +++++++ .tmux.conf | 23 +++++++++++++++++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100755 .config/bash/utils/battery_pc.sh create mode 100755 .config/bash/utils/battery_uc.sh create mode 100644 .tmux.conf diff --git a/.bash_aliases b/.bash_aliases index 7c0d5ed..efc6cc4 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -7,11 +7,15 @@ alias :q="exit" alias spellen="aspell -l en check" alias spellit="aspell -l it check" +# Battery (Linux) +alias battery_pc="~/.config/bash/utils/battery_pc.sh" +alias battery_uc="~/.config/bash/utils/battery_uc.sh" + # Thanks to DistroTube # Changing "ls" to "exa"; Edited -alias ls='exa -l --color=always --group-directories-first' # my preferred listing -alias la='exa -al --color=always --group-directories-first' # all files and dirs -alias ll='exa --color=always --group-directories-first' # long format -alias lt='exa -aT --color=always --group-directories-first' # tree listing -alias l.='exa -a | egrep "^\."' +# alias ls='exa -l --color=always --group-directories-first' # my preferred listing +# alias la='exa -al --color=always --group-directories-first' # all files and dirs +# alias ll='exa --color=always --group-directories-first' # long format +# alias lt='exa -aT --color=always --group-directories-first' # tree listing +# alias l.='exa -a | egrep "^\."' diff --git a/.config/bash/utils/battery_pc.sh b/.config/bash/utils/battery_pc.sh new file mode 100755 index 0000000..31ed358 --- /dev/null +++ b/.config/bash/utils/battery_pc.sh @@ -0,0 +1 @@ +upower -d dump | grep percentage: | head -n 1 | sed 's/percentage://' | tr " " "\0" diff --git a/.config/bash/utils/battery_uc.sh b/.config/bash/utils/battery_uc.sh new file mode 100755 index 0000000..b0ee5b9 --- /dev/null +++ b/.config/bash/utils/battery_uc.sh @@ -0,0 +1,7 @@ +state=$(upower -d dump | grep state: | head -n 1 | sed 's/state://' | tr -d " \t\0") + +if [ "$state" == "discharging" ]; then + echo "no" +else + echo "yes" +fi diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..635dcc9 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,23 @@ +# Panes motion and split +unbind '"' +unbind % +bind v split-window -h +bind h split-window -v +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Window motion +unbind 'w' +unbind 'l' +bind w new-window -c "#{pane_current_path}" +bind l last-window + +# Mouse always on +set -g mouse on + +# Status bar +set -g status-bg white +set -g status-fg black +set-option -g status-right "%a %d-%b-%y %I:%M %p" -- 2.43.0