]> git repos ~mattia - some.files.git/commitdiff
Bash battery scripts & TMUX small config
authorMattia Cabrini <dev@mattiacabrini.com>
Sat, 1 Feb 2025 17:24:15 +0000 (18:24 +0100)
committerMattia Cabrini <dev@mattiacabrini.com>
Sat, 1 Feb 2025 17:24:15 +0000 (18:24 +0100)
.bash_aliases
.config/bash/utils/battery_pc.sh [new file with mode: 0755]
.config/bash/utils/battery_uc.sh [new file with mode: 0755]
.tmux.conf [new file with mode: 0644]

index 7c0d5ed5fad4a119cdaca54228035de5804da59b..efc6cc4af71e1b499055c7d4c5d59e11338e7991 100644 (file)
@@ -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 <https://gitlab.com/dwt1/dotfiles/>
 # 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 (executable)
index 0000000..31ed358
--- /dev/null
@@ -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 (executable)
index 0000000..b0ee5b9
--- /dev/null
@@ -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 (file)
index 0000000..635dcc9
--- /dev/null
@@ -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"