From 25e0d0460b0dfb134a555db28259073cf1d3a4a1 Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Sun, 6 Jul 2025 16:21:42 +0200 Subject: [PATCH] migrate dotfiles to chezmoi --- .chezmoiignore | 1 + .gitignore | 1 - README.md | 11 +- auto-update.sh | 59 - profiles/base/.Xmodmap => dot_Xmodmap | 0 profiles/base/.aliases => dot_aliases | 0 profiles/base/.environment => dot_environment | 0 profiles/base/.gitconfig => dot_gitconfig | 0 profiles/base/.p10k.zsh => dot_p10k.zsh | 0 profiles/base/.tmux.conf => dot_tmux.conf | 0 profiles/base/.vimrc => dot_vimrc | 0 .../.zsh_plugins.txt => dot_zsh_plugins.txt | 0 profiles/base/.zshrc => dot_zshrc | 0 dotfiles.sh | 65 - install.sh | 66 - .../fontconfig/fonts.conf | 0 .../matplotlib/matplotlibrc | 0 .../matplotlib/stylelib/hcnd.mplstyle | 0 .../matplotlib/stylelib/poster.mplstyle | 0 .../matplotlib/stylelib/presentation.mplstyle | 0 .../matplotlib/stylelib/publication.mplstyle | 0 .../stylelib/publication_old.mplstyle | 0 .../nvim/init.vim | 0 profiles/base/.local/bin/github_http2ssh | 33 - profiles/i3/.config/i3/config | 258 -- .../i3/.config/i3/scripts/change_monitor.sh | 20 - profiles/i3/.config/i3/scripts/cpu_usage | 60 - profiles/i3/.config/i3/scripts/current_track | 4 - profiles/i3/.config/i3/scripts/disk | 42 - profiles/i3/.config/i3/scripts/exit_menu | 12 - profiles/i3/.config/i3/scripts/gpu | 21 - .../i3/.config/i3/scripts/keyboard_layout | 1 - profiles/i3/.config/i3/scripts/load_average | 35 - profiles/i3/.config/i3/scripts/memory | 67 - profiles/i3/.config/i3/scripts/openvpn | 151 - profiles/i3/.config/i3/scripts/shutdown_menu | 186 - profiles/i3/.config/i3/scripts/song.awk | 22 - profiles/i3/.config/i3/scripts/spotify.py | 12 - .../i3/.config/i3/scripts/spotify_control | 40 - .../i3/.config/i3/scripts/spotify_control.bck | 40 - profiles/i3/.config/i3/scripts/ssd | 41 - profiles/i3/.config/i3/scripts/tmux | 4 - profiles/i3/.config/i3/scripts/volume | 46 - .../i3/.config/i3/scripts/volume-pulseaudio | 162 - profiles/i3/.config/i3/scripts/volume_1 | 71 - profiles/i3/.config/polybar/config.d/base_bar | 19 - profiles/i3/.config/polybar/config.d/colors | 11 - profiles/i3/.config/polybar/config.d/modules | 416 -- profiles/i3/.config/polybar/config.d/settings | 7 - profiles/i3/.config/polybar/gpu.sh | 21 - profiles/i3/.config/polybar/spotify.py | 29 - .../.config/polybar/spotify/launchlistener.sh | 3 - .../polybar/spotify/py_spotify_listener.py | 125 - .../.config/polybar/spotify/spotify_status.py | 67 - profiles/i3/.config/rofi/config.rasi | 7 - profiles/i3/.config/rofi/slate.rasi | 43 - profiles/pymol/.pymol/.pymol | 1 - profiles/pymol/.pymol/pymol-edu-license.lic | 8 - .../.pymol/startup/Draw_Protein_Dimensions.py | 362 -- .../.pymol/startup/anglebetweenhelices.py | 316 -- profiles/pymol/.pymol/startup/autodock.py | 4045 ----------------- profiles/pymol/.pymol/startup/axes.py | 68 - .../pymol/.pymol/startup/center_of_mass.py | 86 - profiles/pymol/.pymol/startup/centroid.py | 66 - profiles/pymol/.pymol/startup/color_h.py | 128 - profiles/pymol/.pymol/startup/dssp_stride.py | 981 ---- profiles/pymol/.pymol/startup/propka.py | 887 ---- .../pymol/.pymol/startup/show_contact_map.py | 58 - .../pymol/.pymol/startup/spectrum_states.py | 92 - .../.pymol/startup/visualize_dca_scores.py | 87 - profiles/pymol/.pymolrc | 76 - run_onchange_before_0_install-packages.sh | 15 + run_onchange_before_1_zsh.sh | 29 + run_onchange_before_20_fzf.sh | 10 + run_onchange_before_21_diff-so-fancy.sh | 9 + run_onchange_before_22_vimplug.sh | 7 + 76 files changed, 77 insertions(+), 9533 deletions(-) create mode 100644 .chezmoiignore delete mode 100644 .gitignore delete mode 100755 auto-update.sh rename profiles/base/.Xmodmap => dot_Xmodmap (100%) rename profiles/base/.aliases => dot_aliases (100%) rename profiles/base/.environment => dot_environment (100%) rename profiles/base/.gitconfig => dot_gitconfig (100%) rename profiles/base/.p10k.zsh => dot_p10k.zsh (100%) rename profiles/base/.tmux.conf => dot_tmux.conf (100%) rename profiles/base/.vimrc => dot_vimrc (100%) rename profiles/base/.zsh_plugins.txt => dot_zsh_plugins.txt (100%) rename profiles/base/.zshrc => dot_zshrc (100%) delete mode 100755 dotfiles.sh delete mode 100755 install.sh rename {profiles/base/.config => private_dot_config}/fontconfig/fonts.conf (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/matplotlibrc (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/stylelib/hcnd.mplstyle (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/stylelib/poster.mplstyle (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/stylelib/presentation.mplstyle (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/stylelib/publication.mplstyle (100%) rename {profiles/base/.config => private_dot_config}/matplotlib/stylelib/publication_old.mplstyle (100%) rename {profiles/base/.config => private_dot_config}/nvim/init.vim (100%) delete mode 100755 profiles/base/.local/bin/github_http2ssh delete mode 100644 profiles/i3/.config/i3/config delete mode 100755 profiles/i3/.config/i3/scripts/change_monitor.sh delete mode 100755 profiles/i3/.config/i3/scripts/cpu_usage delete mode 100755 profiles/i3/.config/i3/scripts/current_track delete mode 100755 profiles/i3/.config/i3/scripts/disk delete mode 100755 profiles/i3/.config/i3/scripts/exit_menu delete mode 100755 profiles/i3/.config/i3/scripts/gpu delete mode 100755 profiles/i3/.config/i3/scripts/keyboard_layout delete mode 100755 profiles/i3/.config/i3/scripts/load_average delete mode 100755 profiles/i3/.config/i3/scripts/memory delete mode 100755 profiles/i3/.config/i3/scripts/openvpn delete mode 100755 profiles/i3/.config/i3/scripts/shutdown_menu delete mode 100755 profiles/i3/.config/i3/scripts/song.awk delete mode 100755 profiles/i3/.config/i3/scripts/spotify.py delete mode 100755 profiles/i3/.config/i3/scripts/spotify_control delete mode 100755 profiles/i3/.config/i3/scripts/spotify_control.bck delete mode 100755 profiles/i3/.config/i3/scripts/ssd delete mode 100755 profiles/i3/.config/i3/scripts/tmux delete mode 100755 profiles/i3/.config/i3/scripts/volume delete mode 100755 profiles/i3/.config/i3/scripts/volume-pulseaudio delete mode 100755 profiles/i3/.config/i3/scripts/volume_1 delete mode 100644 profiles/i3/.config/polybar/config.d/base_bar delete mode 100644 profiles/i3/.config/polybar/config.d/colors delete mode 100644 profiles/i3/.config/polybar/config.d/modules delete mode 100644 profiles/i3/.config/polybar/config.d/settings delete mode 100755 profiles/i3/.config/polybar/gpu.sh delete mode 100755 profiles/i3/.config/polybar/spotify.py delete mode 100755 profiles/i3/.config/polybar/spotify/launchlistener.sh delete mode 100755 profiles/i3/.config/polybar/spotify/py_spotify_listener.py delete mode 100644 profiles/i3/.config/polybar/spotify/spotify_status.py delete mode 100644 profiles/i3/.config/rofi/config.rasi delete mode 100644 profiles/i3/.config/rofi/slate.rasi delete mode 120000 profiles/pymol/.pymol/.pymol delete mode 100644 profiles/pymol/.pymol/pymol-edu-license.lic delete mode 100644 profiles/pymol/.pymol/startup/Draw_Protein_Dimensions.py delete mode 100644 profiles/pymol/.pymol/startup/anglebetweenhelices.py delete mode 100644 profiles/pymol/.pymol/startup/autodock.py delete mode 100644 profiles/pymol/.pymol/startup/axes.py delete mode 100644 profiles/pymol/.pymol/startup/center_of_mass.py delete mode 100644 profiles/pymol/.pymol/startup/centroid.py delete mode 100644 profiles/pymol/.pymol/startup/color_h.py delete mode 100644 profiles/pymol/.pymol/startup/dssp_stride.py delete mode 100644 profiles/pymol/.pymol/startup/propka.py delete mode 100644 profiles/pymol/.pymol/startup/show_contact_map.py delete mode 100644 profiles/pymol/.pymol/startup/spectrum_states.py delete mode 100644 profiles/pymol/.pymol/startup/visualize_dca_scores.py delete mode 100644 profiles/pymol/.pymolrc create mode 100644 run_onchange_before_0_install-packages.sh create mode 100644 run_onchange_before_1_zsh.sh create mode 100644 run_onchange_before_20_fzf.sh create mode 100644 run_onchange_before_21_diff-so-fancy.sh create mode 100644 run_onchange_before_22_vimplug.sh diff --git a/.chezmoiignore b/.chezmoiignore new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/.chezmoiignore @@ -0,0 +1 @@ +README.md diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 04fba55..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -./pymolrc/*pyc diff --git a/README.md b/README.md index 7ea8fcf..0f3e85a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -# dotfiles for linux/wsl +# My dotfiles -clone to `.dotfiles`. +Set up on new machin: -Start by installing the base configuration via `./install.sh`. -Then choose relevant configuration bundles with `./dotfiles.sh bundname` -(i.e. `./dotfiles.sh gui`) +```bash +sh -c "$(curl -fsLS get.chezmoi.io)" +chezmoi init --apply dnlbauer +``` diff --git a/auto-update.sh b/auto-update.sh deleted file mode 100755 index 60f9c41..0000000 --- a/auto-update.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# adapted from: https://github.com/jez/dotfiles/blob/master/util/auto-update.sh - -# Number of seconds to wait before printing a reminder -UPDATE_THRESHOLD="604800" # 1 week - -check_for_updates() { - [ ! -e $HOME/.dotfiles_update ] && touch $HOME/.dotfiles_update - # Initialize for when we have no GNU date available - last_check=0 - time_now=0 - - # Darwin uses BSD, check for gdate, else use date - if [[ $(uname) = "Darwin" && -n $(which gdate) ]]; then - last_login=$(gdate -r ~/.dotfiles_update +%s) - time_now=$(gdate +%s) - else - # Ensure this is GNU grep - if [ -n "$(date --version 2> /dev/null | grep GNU)" ]; then - last_login=$(date -r ~/.dotfiles_update +%s) - time_now=$(date +%s) - fi - fi - - time_since_check=$((time_now - last_login)) - - if [ "$time_since_check" -ge "$UPDATE_THRESHOLD" ]; then - echo $time_since_check - else - echo 0 - fi -} - -update() { - # Record that we've update - touch $HOME/.dotfiles_update - - # Update dotfiles repo - cd ~/.dotfiles/ - - echo "Checking for updates..." - git fetch --quiet origin - if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/master)" ]; then - echo "--> outdated." - git pull - ./install.sh - else - echo "--> nothing to do." - fi - - cd - &> /dev/null -} - -check=$(check_for_updates) -if [[ $check -gt 0 ]]; then - echo "Dotfiles might be out of date." - update -fi - diff --git a/profiles/base/.Xmodmap b/dot_Xmodmap similarity index 100% rename from profiles/base/.Xmodmap rename to dot_Xmodmap diff --git a/profiles/base/.aliases b/dot_aliases similarity index 100% rename from profiles/base/.aliases rename to dot_aliases diff --git a/profiles/base/.environment b/dot_environment similarity index 100% rename from profiles/base/.environment rename to dot_environment diff --git a/profiles/base/.gitconfig b/dot_gitconfig similarity index 100% rename from profiles/base/.gitconfig rename to dot_gitconfig diff --git a/profiles/base/.p10k.zsh b/dot_p10k.zsh similarity index 100% rename from profiles/base/.p10k.zsh rename to dot_p10k.zsh diff --git a/profiles/base/.tmux.conf b/dot_tmux.conf similarity index 100% rename from profiles/base/.tmux.conf rename to dot_tmux.conf diff --git a/profiles/base/.vimrc b/dot_vimrc similarity index 100% rename from profiles/base/.vimrc rename to dot_vimrc diff --git a/profiles/base/.zsh_plugins.txt b/dot_zsh_plugins.txt similarity index 100% rename from profiles/base/.zsh_plugins.txt rename to dot_zsh_plugins.txt diff --git a/profiles/base/.zshrc b/dot_zshrc similarity index 100% rename from profiles/base/.zshrc rename to dot_zshrc diff --git a/dotfiles.sh b/dotfiles.sh deleted file mode 100755 index bd82c6e..0000000 --- a/dotfiles.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - - -PROFILE_BASE_DIR=$HOME/.dotfiles/profiles - -# Link files of a single profile -link_profile() { - profile=$1 - profile_dir=${PROFILE_BASE_DIR}/$profile - - - if [ ! -d $profile_dir ]; then - echo "$profile does not exist" - exit 1 - else - echo "Linking files from profile $profile" - fi - - cd $profile_dir - OIFS="$IFS" - IFS=$'\n' - # Find all files to link - for file in `find . -type f | cut -c 3- | grep -v "^$"`; do - dir=$(dirname "${file}") - src=`pwd`/$file - dst_dir=$HOME/$dir - dst=$HOME/$file - - # create folder if not exist - if [ ! -d "$dst_dir" ]; then - echo "Creating destination direcory $dst_dir" - mkdir -p $dst_dir - fi - - # link file - echo "Linking $src to $dst" - if [ -f "${dst}" ] || [ -L "${dst}" ]; then - difference="$(diff -y $src $dst)" - if [ "$?" -ne 0 ]; then - echo "$difference" - echo "$(basename $dst) already exists (and differs). Override? [y/N]" - read response - if [ "$response" == 'y' ] || [ "$response" == 'Y' ] \ - || [ "$response" == 'yes' ] || [ "$response" == 'Yes' ]; then - ln -sf $src $dst - else - echo "Skipping $file" - fi - else - echo "Skipping $file (no diff)" - fi - else - ln -s $src $dst - fi - done -} - -# link profiles -if [ "$1" == "link" ]; then - shift - while [ "$1" != "" ]; do - link_profile $1 - shift - done -fi diff --git a/install.sh b/install.sh deleted file mode 100755 index d614b65..0000000 --- a/install.sh +++ /dev/null @@ -1,66 +0,0 @@ -# fzf -if [ ! -d "$HOME/.fzf" ]; then - git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf - if [ ! -f "$HOME/.fzf/bin" ]; then - $HOME/.fzf/install --completion --key-bindings --update-rc - fi -fi - -# diff-so-fancy -if [ ! -f "$HOME/.local/bin/diff-so-fancy" ]; then - if [ ! -d "$HOME/.local/lib/diff-so-fancy" ]; then - git clone --depth 1 https://github.com/so-fancy/diff-so-fancy.git $HOME/.local/lib/diff-so-fancy - fi - ln -s $HOME/.local/lib/diff-so-fancy/diff-so-fancy $HOME/.local/bin/diff-so-fancy -fi - -# vimplug -if [ ! -d "$HOME/.vim/autoload" ]; then - echo "setup vim plug" - curl -fLo $HOME/.vim/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -fi - -# install rust -if [ ! -d "$HOME/.cargo" ]; then - echo "setup cargo" - curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y --profile minimal -q -fi - -# install some rust packages -for package in ripgrep bat; do - echo "setup $package" - $HOME/.cargo/bin/cargo install -q $package -done - -# linking dotfiles -$HOME/.dotfiles/dotfiles.sh link base - -if ! type zsh > /dev/null; then - echo "Cannnot change default shell to zsh: not installed" -else - # Make ZSH the default shell environment - if [ $(cat /etc/passwd | grep $USER | awk -F ':' '{print substr($7, length($7)-3)}') != "/zsh" ]; then - echo "Changing shell to zsh" - chsh -s $(which zsh) - fi - - # Antidote Installation - if [ ! -d "$HOME/.antidote" ]; then - echo "Installing antidote" - - # make sure git is installed - if ! type git > /dev/null; then - echo "Git not installed. Cannot install antidote" - else - git clone --depth=1 https://github.com/mattmc3/antidote.git $HOME/.antidote - fi - - else - echo "antidote already exists." - fi - -fi - - - diff --git a/profiles/base/.config/fontconfig/fonts.conf b/private_dot_config/fontconfig/fonts.conf similarity index 100% rename from profiles/base/.config/fontconfig/fonts.conf rename to private_dot_config/fontconfig/fonts.conf diff --git a/profiles/base/.config/matplotlib/matplotlibrc b/private_dot_config/matplotlib/matplotlibrc similarity index 100% rename from profiles/base/.config/matplotlib/matplotlibrc rename to private_dot_config/matplotlib/matplotlibrc diff --git a/profiles/base/.config/matplotlib/stylelib/hcnd.mplstyle b/private_dot_config/matplotlib/stylelib/hcnd.mplstyle similarity index 100% rename from profiles/base/.config/matplotlib/stylelib/hcnd.mplstyle rename to private_dot_config/matplotlib/stylelib/hcnd.mplstyle diff --git a/profiles/base/.config/matplotlib/stylelib/poster.mplstyle b/private_dot_config/matplotlib/stylelib/poster.mplstyle similarity index 100% rename from profiles/base/.config/matplotlib/stylelib/poster.mplstyle rename to private_dot_config/matplotlib/stylelib/poster.mplstyle diff --git a/profiles/base/.config/matplotlib/stylelib/presentation.mplstyle b/private_dot_config/matplotlib/stylelib/presentation.mplstyle similarity index 100% rename from profiles/base/.config/matplotlib/stylelib/presentation.mplstyle rename to private_dot_config/matplotlib/stylelib/presentation.mplstyle diff --git a/profiles/base/.config/matplotlib/stylelib/publication.mplstyle b/private_dot_config/matplotlib/stylelib/publication.mplstyle similarity index 100% rename from profiles/base/.config/matplotlib/stylelib/publication.mplstyle rename to private_dot_config/matplotlib/stylelib/publication.mplstyle diff --git a/profiles/base/.config/matplotlib/stylelib/publication_old.mplstyle b/private_dot_config/matplotlib/stylelib/publication_old.mplstyle similarity index 100% rename from profiles/base/.config/matplotlib/stylelib/publication_old.mplstyle rename to private_dot_config/matplotlib/stylelib/publication_old.mplstyle diff --git a/profiles/base/.config/nvim/init.vim b/private_dot_config/nvim/init.vim similarity index 100% rename from profiles/base/.config/nvim/init.vim rename to private_dot_config/nvim/init.vim diff --git a/profiles/base/.local/bin/github_http2ssh b/profiles/base/.local/bin/github_http2ssh deleted file mode 100755 index 56a17b2..0000000 --- a/profiles/base/.local/bin/github_http2ssh +++ /dev/null @@ -1,33 +0,0 @@ -#/bin/bash -#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password - -REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https?://[^[:space:]]*).*#\1#p'` -if [ -z "$REPO_URL" ]; then - echo "-- ERROR: Could not identify Repo url." - echo " It is possible this repo is already using SSH instead of HTTPS." - exit -fi - -USER=`echo $REPO_URL | sed -Ene's#https?://github.com/([^/]*)/(.*)[\.git]?#\1#p'` -if [ -z "$USER" ]; then - echo "-- ERROR: Could not identify User." - exit -fi - -REPO=`echo $REPO_URL | sed -Ene's#https?://github.com/([^/]*)/(.*)[\.git]?#\2#p'` -if [ -z "$REPO" ]; then - echo "-- ERROR: Could not identify Repo." - exit -fi - -NEW_URL="git@github.com:$USER/$REPO.git" -echo "Changing repo url from " -echo " '$REPO_URL'" -echo " to " -echo " '$NEW_URL'" -echo "" - -CHANGE_CMD="git remote set-url origin $NEW_URL" -`$CHANGE_CMD` - -echo "Success" diff --git a/profiles/i3/.config/i3/config b/profiles/i3/.config/i3/config deleted file mode 100644 index 18c1cf2..0000000 --- a/profiles/i3/.config/i3/config +++ /dev/null @@ -1,258 +0,0 @@ -# This file has been auto-generated by i3-config-wizard(1). -# It will not be overwritten, so edit it as you like. -# -# Should you change your keyboard layout somewhen, delete -# this file and re-run i3-config-wizard(1). -# - -# i3 config file (v4) -# -# Please see http://i3wm.org/docs/userguide.html for a complete reference! -# exec xrandr --auto --output DP-4 --right-of HDMI-0 --primary --dpi 150 -exec --no-startup-id ~/.config/i3/xrandr.sh - - -set $mod Mod4 - -# Font for window titles. Will also be used by the bar unless a different font -# is used in the bar {} block below. ISO 10646 = Unicode -font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 -# The font above is very space-efficient, that is, it looks good, sharp and -# clear in small sizes. However, if you need a lot of unicode glyphs or -# right-to-left text rendering, you should instead use pango for rendering and -# chose a FreeType font, such as: -font pango:Source Code Pro for Powerline, FontAwesome Regular, Icons 12.5 - -new_window 1pixel - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -bindsym $mod+Return exec i3-sensible-terminal - -# kill focused window -bindsym $mod+Shift+q kill - -# start dmenu (a program launcher) -#bindsym $mod+d exec dmenu_run - -# rofi -bindsym $mod+d exec "rofi -show combi" - - -# There also is the (new) i3-dmenu-desktop which only displays applications -# shipping a .desktop file. It is a wrapper around dmenu, so you need that -# installed. -# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop - -# change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right - -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - -# move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+colon move right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# move workspace left/right -bindsym $mod+Shift+greater move workspace to output right -bindsym $mod+Shift+less move workspace to output left - -# split in horizontal orientation -bindsym $mod+h split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen - -# change container layout (stacked, tabbed, toggle split) -#bindsym $mod+s layout stacking -#bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - -set $workspace1 1 -set $workspace2 2 -set $workspace3 3 -set $workspace4 4 -set $workspace5 5 -set $workspace6 6 -set $workspace7 7 - # -set $workspace8 8 -# -set $workspace9 9 -# - -# switch to workspace -bindsym $mod+1 workspace $workspace1 -bindsym $mod+2 workspace $workspace2 -bindsym $mod+3 workspace $workspace3 -bindsym $mod+4 workspace $workspace4 -bindsym $mod+5 workspace $workspace5 -bindsym $mod+6 workspace $workspace6 -bindsym $mod+7 workspace $workspace7 -bindsym $mod+8 workspace $workspace8 -bindsym $mod+9 workspace $workspace9 -bindsym $mod+0 workspace $workspace10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace $workspace1 -bindsym $mod+Shift+2 move container to workspace $workspace2 -bindsym $mod+Shift+3 move container to workspace $workspace3 -bindsym $mod+Shift+4 move container to workspace $workspace4 -bindsym $mod+Shift+5 move container to workspace $workspace5 -bindsym $mod+Shift+6 move container to workspace $workspace6 -bindsym $mod+Shift+7 move container to workspace $workspace7 -bindsym $mod+Shift+8 move container to workspace $workspace8 -bindsym $mod+Shift+9 move container to workspace $workspace9 -bindsym $mod+Shift+0 move container to workspace $workspace10 - -# Make the currently focused window a scratchpad -bindsym $mod+Shift+minus move scratchpad - -# Show the first scratchpad window -bindsym $mod+minus scratchpad show - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" - -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym $mod+r mode "resize" - -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) -#bar { - #position top - # status_command 2> /tmp/i3blocks.err i3blocks -c ~/.config/i3/i3blocks.conf | tee /tmp/i3blocks.out -#} - - -# hide window border -new_window 1pixel - -exec_always --no-startup-id ~/.config/polybar/polybar.sh - - -# "special" workspaces -# workspace7 => zotero -# worksapce8 => chat -# workspace9 => emailing -# workspace0 => music -workspace $workspace7 output eDP-1 -assign [class="Zotero"] → $workspace7 -assign [class="Mendeley"] → $workspace7 - -workspace $workspace8 output eDP-1 -assign [class="Skype" title="Skype"] → $workspace8 -assign [class="Mattermost" instance="mattermost"] → $workspace8 -assign [class="Rambox" instance="rambox"] → $workspace8 - -workspace $workspace9 output eDP-1 -assign [class="thunderbird" window_role="3pane"] → $workspace9 - -workspace $workspace10 output eDP-1 -assign [class="Spotify"] → $workspace10 - -for_window [window_role="pop-up"] floating enable -for_window [class="Chromium" window_role="pop-up"] floating disable -for_window [class="Tk"] floating enable -for_window [title="PyMOL Viewer"] floating enable -for_window [class="Toplevel"] floating enable -for_window [title="Figure*" instance="matplotlib"] floating enable -for_window [window_role="conversation" class="Pidgin"] floating enable -for_window [class="Com.github.alainm23.planner"] floating enable - -# use tiling mode only for main/chat Skype window and floating of all dialogs -# Skype main window title looks like this - "alexey.diyan - Skype™" -for_window [instance="skype" title="^.*?(? /tmp/monitor_mode.dat diff --git a/profiles/i3/.config/i3/scripts/cpu_usage b/profiles/i3/.config/i3/scripts/cpu_usage deleted file mode 100755 index c445c58..0000000 --- a/profiles/i3/.config/i3/scripts/cpu_usage +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/perl -# -# Copyright 2014 Pierre Mavro -# Copyright 2014 Vivien Didelot -# Copyright 2014 Andreas Guldstrand -# -# Licensed under the terms of the GNU GPL v3, or any later version. - -use strict; -use warnings; -use utf8; -use Getopt::Long; - -# default values -my $t_warn = 50; -my $t_crit = 80; -my $cpu_usage = -1; -my $decimals = 0; - -sub help { - print "Usage: cpu_usage [-w ] [-c ] [-d ]\n"; - print "-w : warning threshold to become yellow\n"; - print "-c : critical threshold to become red\n"; - print "-d : Use decimals for percentage (default is $decimals) \n"; - exit 0; -} - -GetOptions("help|h" => \&help, -"w=i" => \$t_warn, -"c=i" => \$t_crit, -"d=i" => \$decimals, -); - -# Get CPU usage -$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is -open (MPSTAT, 'mpstat 1 1 |') or die; -while () { -if (/^.*\s+(\d+\.\d+)\s+$/) { -$cpu_usage = 100 - $1; # 100% - %idle -last; -} -} -close(MPSTAT); - -$cpu_usage eq -1 and die 'Can\'t find CPU information'; - -# Print short_text, full_text -printf "%.${decimals}f%%\n", $cpu_usage; -printf "%.${decimals}f%%\n", $cpu_usage; - -# Print color, if needed -if ($cpu_usage >= $t_crit) { -print "#fb4934\n"; -exit 33; -} elsif ($cpu_usage >= $t_warn) { -print "#fabd2f\n"; -} - -exit 0; - diff --git a/profiles/i3/.config/i3/scripts/current_track b/profiles/i3/.config/i3/scripts/current_track deleted file mode 100755 index 0eca7de..0000000 --- a/profiles/i3/.config/i3/scripts/current_track +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -eval $($(dirname $0)/sp eval) -echo ${SPOTIFY_ARTIST} - ${SPOTIFY_TITLE} diff --git a/profiles/i3/.config/i3/scripts/disk b/profiles/i3/.config/i3/scripts/disk deleted file mode 100755 index 07dd093..0000000 --- a/profiles/i3/.config/i3/scripts/disk +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 Julien Bonjean - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -DIR="/scratch" -ALERT_LOW="${1:-10}" # color will turn red under this value (default: 10%) - -df -h -P "$DIR" | awk -v alert_low=$ALERT_LOW ' -/\/.*/ { -# full text -print $4" ("$5")" - -# short text -print $4 - -use=$5 - -# no need to continue parsing -exit 0 -} - -END { -gsub(/%$/,"",use) -if (100 - use < alert_low) { - # color - print "#FF0000" -} -} -' - diff --git a/profiles/i3/.config/i3/scripts/exit_menu b/profiles/i3/.config/i3/scripts/exit_menu deleted file mode 100755 index ca02b26..0000000 --- a/profiles/i3/.config/i3/scripts/exit_menu +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -while [ "$select" != "NO" -a "$select" != "YES" ]; do - select=$(echo -e 'NO\nYES' | dmenu -nb '#2f343f' - -nf '#f3f4f5' - -sb '#9575cd' - -sf '#f3f4f5' - -fn '-*-*-medium-r-normal-*-*-*-*-*-*-100-*-*' - - i -p "Are you sure you want to logout?") - [ -z "$select" ] && exit 0 -done -[ "$select" = "NO" ] && exit 0 -i3-msg exit diff --git a/profiles/i3/.config/i3/scripts/gpu b/profiles/i3/.config/i3/scripts/gpu deleted file mode 100755 index 3cfcf84..0000000 --- a/profiles/i3/.config/i3/scripts/gpu +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -t_warn=50 -t_crit=70 - -GPU=$(nvidia-smi -q | grep Gpu | awk '{print $3}') - -if [ $GPU -gt $t_crit ] -then - printf " %d%%" "$GPU" - printf "\n %d%%" "$GPU" - printf "\n#fb4934\n" -elif [ $GPU -gt $t_warn ] -then - printf " %d%%" "$GPU" - printf "\n %d%%" "$GPU" - printf "\n#fabd2f\n" -else - printf " %d%%" "$GPU" - printf "\n %d%%" "$GPU" -fi diff --git a/profiles/i3/.config/i3/scripts/keyboard_layout b/profiles/i3/.config/i3/scripts/keyboard_layout deleted file mode 100755 index 8d71903..0000000 --- a/profiles/i3/.config/i3/scripts/keyboard_layout +++ /dev/null @@ -1 +0,0 @@ -xkb-switch diff --git a/profiles/i3/.config/i3/scripts/load_average b/profiles/i3/.config/i3/scripts/load_average deleted file mode 100755 index 67e48f1..0000000 --- a/profiles/i3/.config/i3/scripts/load_average +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 Julien Bonjean - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -load="$(cut -d ' ' -f1 /proc/loadavg)" -cpus="$(nproc)" - -# full text -echo "$load" - -# short text -echo "$load" - -# color if load is too high -awk -v cpus=$cpus -v cpuload=$load ' - BEGIN { - if (cpus <= cpuload) { - print "#FF0000"; - exit 33; - } - } -' - diff --git a/profiles/i3/.config/i3/scripts/memory b/profiles/i3/.config/i3/scripts/memory deleted file mode 100755 index 1f94123..0000000 --- a/profiles/i3/.config/i3/scripts/memory +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 Julien Bonjean - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -TYPE="${BLOCK_INSTANCE:-mem}" - -awk -v type=$TYPE ' -/^MemTotal:/ { - mem_total=$2 -} -/^MemFree:/ { - mem_free=$2 -} -/^Buffers:/ { - mem_free+=$2 -} -/^Cached:/ { - mem_free+=$2 -} -/^SwapTotal:/ { - swap_total=$2 -} -/^SwapFree:/ { - swap_free=$2 -} -END { -if (type == "swap") { - free=swap_free/1024/102 - used=(swap_total-swap_free)/1024/1024 - total=swap_total/1024/1024 -} else { -free=mem_free/1024/1024 -used=(mem_total-mem_free)/1024/1024 -total=mem_total/1024/1024 -} -pct=used/total*100 - -# full text -printf("%.1fG / %.1fG ( %.f%% )\n", used, total, pct) - -# short text -printf("%.f%%\n", pct) - -# color -if (pct > 90) { - print("#E53935\n") - -} else if (pct > 80) { -print("#FFAE00\n") -} else if (pct > 70) { -print("#FFF600\n") -} -} -' /proc/meminfo - diff --git a/profiles/i3/.config/i3/scripts/openvpn b/profiles/i3/.config/i3/scripts/openvpn deleted file mode 100755 index a4a357f..0000000 --- a/profiles/i3/.config/i3/scripts/openvpn +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/perl -# Made by Pierre Mavro/Deimosfr -# Minor contribution by Thor K. H. -# Licensed under the terms of the GNU GPL v3, or any later version. -# Version: 0.3 - -# Usage: -# 1. The configuration name of OpenVPN should be familiar for you (home,work...) -# 2. The device name in your configuration file should be fully named (tun0,tap1...not only tun or tap) -# 3. When you launch one or multiple OpenVPN connexion, be sure the PID file is written in the correct folder (ex: --writepid /run/openvpn/home.pid) - -use strict; -use warnings; -use utf8; -use Getopt::Long; - -my $openvpn_enabled='/dev/shm/openvpn_i3blocks_enabled'; -my $openvpn_disabled='/dev/shm/openvpn_i3blocks_disabled'; - -# Print output -sub print_output { - my $ref_pid_files = shift; - my @pid_files = @$ref_pid_files; - my $change=0; - - # Total pid files - my $total_pid = @pid_files; - if ($total_pid == 0) { - print "down\n"x2; - # Delete OpenVPN i3blocks temp files - if (-f $openvpn_enabled) { - unlink $openvpn_enabled or die "Can't delete $openvpn_enabled\n"; - # Colorize if VPN has just went down - print '#FF0000\n'; - } - unless (-f $openvpn_disabled) { - open(my $shm, '>', $openvpn_disabled) or die "Can't write $openvpn_disabled\n"; - } - exit(0); - } - - # Check if interface device is present - my $vpn_found=0; - my $pid; - my $cmd_line; - my @config_name; - my @config_path; - my $interface; - my $current_config_path; - my $current_config_name; - foreach (@pid_files) { - # Get current PID - $pid=0; - open(PID, '<', $_); - while() { - chomp $_; - $pid = $_; - } - close(PID); - # Check if PID has been found - if ($pid ==0) { - print "Can't get PID $_: $!\n"; - } - - # Check if PID is still alive - $cmd_line='/proc/'.$pid.'/cmdline'; - if (-f $cmd_line) { - # Get config name - open(CMD_LINE, '<', $cmd_line); - while() { - chomp $_; - if ($_ =~ /--config\s*(.*\.conf)/) { - # Get interface from config file - $current_config_path = $1; - # Remove unwanted escape chars - $current_config_path =~ s/\x{00}//g; - $interface = 'null'; - # Get configuration name - if ($current_config_path =~ /(\w+).conf/) { - $current_config_name=$1; - } else { - $current_config_name='unknow'; - } - # Get OpenVPN interface device name - open(CONFIG, '<', $current_config_path) or die "Can't read config file '$current_config_path': $!\n"; - while() { - chomp $_; - if ($_ =~ /dev\s+(\w+)/) { - $interface=$1; - last; - } - } - close(CONFIG); - # check if interface exist - unless ($interface eq 'null') { - if (-d "/sys/class/net/$interface") { - push @config_name, $current_config_name; - $vpn_found=1; - # Write enabled file - unless (-f $openvpn_enabled) { - open(my $shm, '>', $openvpn_enabled) or die "Can't write $openvpn_enabled\n"; - $change=1; - } - } - } - } - } - close(CMD_LINE); - } - } - - # Check if PID found - my $names; - my $short_status; - if ($vpn_found == 1) { - $names = join('/', @config_name); - $short_status='up'; - } else { - $short_status='down'; - $names = $short_status; - } - - print "$names\n"; - print "$short_status\n"; - - # Print color if there were changes - print "#00FF00\n" if ($change == 1); - - exit(0); -} - -sub check_opts { - # Vars - my @pid_file=glob '/run/openvpn/*.pid'; - - # Set options - GetOptions( "help|h" => \&help, - "p=s" => \@pid_file); - - print_output(\@pid_file); -} - -sub help { - print "Usage: openvpn [-d pid folder files]\n"; - print "-d : pid folder files (default /run/openvpn/*.pid)\n"; - print "Note: devices in configuration file should be named with their number (ex: tun0, tap1)\n"; - exit(1); -} - -&check_opts; - diff --git a/profiles/i3/.config/i3/scripts/shutdown_menu b/profiles/i3/.config/i3/scripts/shutdown_menu deleted file mode 100755 index 75a9641..0000000 --- a/profiles/i3/.config/i3/scripts/shutdown_menu +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env bash -# -# Use rofi/zenity to change system runstate thanks to systemd. -# -# Note: this currently relies on associative array support in the shell. -# -# Inspired from i3pystatus wiki: -# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu -# -# Copyright 2015 Benjamin Chrétien -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -####################################################################### -# BEGIN CONFIG # -####################################################################### - -# Use a custom lock script -#LOCKSCRIPT="i3lock-extra -m pixelize" - -# Colors: FG (foreground), BG (background), HL (highlighted) -FG_COLOR="#bbbbbb" -BG_COLOR="#111111" -HLFG_COLOR="#111111" -HLBG_COLOR="#bbbbbb" -BORDER_COLOR="#222222" - -# Options not related to colors -ROFI_TEXT="Menu:" -ROFI_OPTIONS="-width -11 -location 3 -hide-scrollbar -bw 2" - -# Zenity options -ZENITY_TITLE="Menu" -ZENITY_TEXT="Action:" -ZENITY_OPTIONS="--column= --hide-header" - -####################################################################### -# END CONFIG # -####################################################################### - -# Whether to ask for user's confirmation -enable_confirmation=false - -# Preferred launcher if both are available -preferred_launcher="rofi" - -usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. - -where: --h show this help text --c ask for user confirmation --p preferred launcher (rofi or zenity) - -This script depends on: -- systemd, -- i3, -- rofi or zenity." - -# Check whether the user-defined launcher is valid -launcher_list=(rofi zenity) -function check_launcher() { - if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then - echo "Supported launchers: ${launcher_list[*]}" - exit 1 - else - # Get array with unique elements and preferred launcher first - # Note: uniq expects a sorted list, so we cannot use it - i=1 - launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ - | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) - fi -} - -# Parse CLI arguments -while getopts "hcp:" option; do - case "${option}" in - h) echo "${usage}" - exit 0 - ;; - c) enable_confirmation=true - ;; - p) preferred_launcher="${OPTARG}" - check_launcher "${preferred_launcher}" - ;; - *) exit 1 - ;; - esac -done - -# Check whether a command exists -function command_exists() { - command -v "$1" &> /dev/null 2>&1 -} - -# systemctl required -if ! command_exists systemctl ; then - exit 1 -fi - -# menu defined as an associative array -typeset -A menu - -# Menu with keys/commands -menu=( -[Shutdown]="systemctl poweroff" -[Reboot]="systemctl reboot" -[Hibernate]="systemctl hibernate" -[Suspend]="systemctl suspend" -[Halt]="systemctl halt" -[Lock]="${LOCKSCRIPT:-i3lock --color=${BG_COLOR#"#"}}" -[Logout]="i3-msg exit" -[Cancel]="" -) -menu_nrows=${#menu[@]} - -# Menu entries that may trigger a confirmation message -menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" - -launcher_exe="" -launcher_options="" -rofi_colors="" - -function prepare_launcher() { - if [[ "$1" == "rofi" ]]; then - rofi_colors="-bc ${BORDER_COLOR} -bg ${BG_COLOR} -fg ${FG_COLOR} \ - -hlfg ${HLFG_COLOR} -hlbg ${HLBG_COLOR}" - launcher_exe="rofi" - launcher_options="-dmenu -i -lines ${menu_nrows} -p ${ROFI_TEXT} \ - ${rofi_colors} ${ROFI_OPTIONS}" - elif [[ "$1" == "zenity" ]]; then - launcher_exe="zenity" - launcher_options="--list --title=${ZENITY_TITLE} --text=${ZENITY_TEXT} \ - ${ZENITY_OPTIONS}" - fi -} - -for l in "${launcher_list[@]}"; do - if command_exists "${l}" ; then - prepare_launcher "${l}" - break - fi -done - -# No launcher available -if [[ -z "${launcher_exe}" ]]; then - exit 1 -fi - -launcher="${launcher_exe} ${launcher_options}" -selection="$(printf '%s\n' "${!menu[@]}" | sort | ${launcher})" - -function ask_confirmation() { - if [ "${launcher_exe}" == "rofi" ]; then - confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ - ${rofi_colors} ${ROFI_OPTIONS}) - [ "${confirmed}" == "Yes" ] && confirmed=0 - elif [ "${launcher_exe}" == "zenity" ]; then - zenity --question --text "Are you sure you want to ${selection,,}?" - confirmed=$? - fi - - if [ "${confirmed}" == 0 ]; then - i3-msg -q "exec ${menu[${selection}]}" - fi -} - -if [[ $? -eq 0 && ! -z ${selection} ]]; then - if [[ "${enable_confirmation}" = true && \ - ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then - ask_confirmation -else - i3-msg -q "exec ${menu[${selection}]}" -fi - fi - diff --git a/profiles/i3/.config/i3/scripts/song.awk b/profiles/i3/.config/i3/scripts/song.awk deleted file mode 100755 index 2ebbcb0..0000000 --- a/profiles/i3/.config/i3/scripts/song.awk +++ /dev/null @@ -1,22 +0,0 @@ -/string *"xesam:artist/{ - while (1) { - getline line - if (line ~ /string "/) { - sub(/.*string "/, "artist:", line) - sub(/".*$/, "", line) - print line - break - } - } -} -/string *"xesam:title/{ - while(1) { - getline line - if (line ~ /string "/) { - sub(/.*string "/, "title:", line) - sub(/".*$/, "", line) - print line - break - } - } -} diff --git a/profiles/i3/.config/i3/scripts/spotify.py b/profiles/i3/.config/i3/scripts/spotify.py deleted file mode 100755 index 1e437ce..0000000 --- a/profiles/i3/.config/i3/scripts/spotify.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/python - -import dbus -try: - bus = dbus.SessionBus() - spotify = bus.get_object("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2") - spotify_iface = dbus.Interface(spotify, 'org.freedesktop.DBus.Properties') - props = spotify_iface.Get('org.mpris.MediaPlayer2.Player', 'Metadata') - print(str(props['xesam:artist'][0]) + " - " + str(props['xesam:title'])) - exit -except dbus.exceptions.DBusException: - exit diff --git a/profiles/i3/.config/i3/scripts/spotify_control b/profiles/i3/.config/i3/scripts/spotify_control deleted file mode 100755 index f04462a..0000000 --- a/profiles/i3/.config/i3/scripts/spotify_control +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -if [ $# -lt 1 ] -then - echo "No command?" - exit -fi - -if [ "$(pidof spotify)" = "" ] -then - echo "Spotify is not running" - exit -fi - -case $1 in - "play") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause - ;; - "next") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next - ;; - "prev") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous - ;; - "getTitle") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getArtist") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getAlbum") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "album"|egrep -v "album"|egrep -v "array"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getStatus") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|grep 'string "[^"]*"'|sed 's/.*"\(.*\)"[^"]*$/\1/' - ;; - *) - echo "Unknown command: " $1 - ;; -esac diff --git a/profiles/i3/.config/i3/scripts/spotify_control.bck b/profiles/i3/.config/i3/scripts/spotify_control.bck deleted file mode 100755 index f04462a..0000000 --- a/profiles/i3/.config/i3/scripts/spotify_control.bck +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -if [ $# -lt 1 ] -then - echo "No command?" - exit -fi - -if [ "$(pidof spotify)" = "" ] -then - echo "Spotify is not running" - exit -fi - -case $1 in - "play") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause - ;; - "next") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next - ;; - "prev") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous - ;; - "getTitle") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getArtist") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getAlbum") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "album"|egrep -v "album"|egrep -v "array"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$ - ;; - "getStatus") - dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|grep 'string "[^"]*"'|sed 's/.*"\(.*\)"[^"]*$/\1/' - ;; - *) - echo "Unknown command: " $1 - ;; -esac diff --git a/profiles/i3/.config/i3/scripts/ssd b/profiles/i3/.config/i3/scripts/ssd deleted file mode 100755 index ea4f715..0000000 --- a/profiles/i3/.config/i3/scripts/ssd +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 Julien Bonjean - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -DIR="/" -ALERT_LOW="${1:-10}" # color will turn red under this value (default: 10%) - -df -h -P "$DIR" | awk -v alert_low=$ALERT_LOW ' -/\/.*/ { - # full text - print $4" ("$5")" - - # short text - print $4 - use=$5 - - # no need to continue parsing - exit 0 -} - -END { - gsub(/%$/,"",use) - if (100 - use < alert_low) { - # color - print "#FF0000" - } -} -' - diff --git a/profiles/i3/.config/i3/scripts/tmux b/profiles/i3/.config/i3/scripts/tmux deleted file mode 100755 index acfea91..0000000 --- a/profiles/i3/.config/i3/scripts/tmux +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -tmux list-sessions | wc -l - diff --git a/profiles/i3/.config/i3/scripts/volume b/profiles/i3/.config/i3/scripts/volume deleted file mode 100755 index 1cca821..0000000 --- a/profiles/i3/.config/i3/scripts/volume +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env perl - -## The sink we are interested in should be given as the -## 1st argument to the script. -my $sink=$ARGV[0] || die("Need a sink number as the first argument\n"); - -## If the script has been run with a second argument, -## that argument will be the volume threshold we are checking -my $volume_limit=$ARGV[1]||undef; - -## Run the pactl command and save the output in -## ther filehandle $fh -open(my $fh, '-|', 'pactl list sinks'); - -## Set the record separator to consecutive newlines (same as -000) -## this means we read the info for each sink as a single "line". -$/="\n\n"; - -## Go through the pactl output -while (<$fh>) { - ## If this is the sink we are interested in - if (/#$sink/) { - ## Extract the current colume of this sink - /Volume:.*?(\d+)%/; - my $volume=$1; - ## If the script has been run with a second argument, - ## check whether the volume is above or below that - if ($volume_limit) { - ## If the volume os greater than or equal to the - ## value passed, print "y" - if ($volume >= $volume_limit) { - print "y\n"; - exit 0; - } - else { - print "n\n"; - exit 1; - } - } - ## Else, if the script has been run with just one argument, - ## print the current volume. - else { - print "$volume%\n"; - } - }# -} diff --git a/profiles/i3/.config/i3/scripts/volume-pulseaudio b/profiles/i3/.config/i3/scripts/volume-pulseaudio deleted file mode 100755 index 2aba24f..0000000 --- a/profiles/i3/.config/i3/scripts/volume-pulseaudio +++ /dev/null @@ -1,162 +0,0 @@ -#!/bin/bash -# Displays the default device, volume, and mute status for i3blocks - -AUDIO_HIGH_SYMBOL=' ' - -AUDIO_MED_THRESH=50 -AUDIO_MED_SYMBOL=' ' - -AUDIO_LOW_THRESH=0 -AUDIO_LOW_SYMBOL=' ' - -AUDIO_MUTED_SYMBOL=' ' - -AUDIO_INTERVAL=5 - -DEFAULT_COLOR="#ffffff" -MUTED_COLOR="#a0a0a0" - -LONG_FORMAT=0 -SHORT_FORMAT=2 -USE_PERCENT=1 -USE_ALSA_NAME=0 -USE_DESCRIPTION=0 - -SUBSCRIBE=0 - -while getopts F:Sf:padH:M:L:X:T:t:C:c:i:h opt; do - case "$opt" in - S) SUBSCRIBE=1 ;; - F) LONG_FORMAT="$OPTARG" ;; - f) SHORT_FORMAT="$OPTARG" ;; - p) USE_PERCENT=0 ;; - a) USE_ALSA_NAME=1 ;; - d) USE_DESCRIPTION=1 ;; - H) AUDIO_HIGH_SYMBOL="$OPTARG" ;; - M) AUDIO_MED_SYMBOL="$OPTARG" ;; - L) AUDIO_LOW_SYMBOL="$OPTARG" ;; - X) AUDIO_MUTED_SYMBOL="$OPTARG" ;; - T) AUDIO_MED_THRESH="$OPTARG" ;; - t) AUDIO_LOW_THRESH="$OPTARG" ;; - C) DEFAULT_COLOR="$OPTARG" ;; - c) MUTED_COLOR="$OPTARG" ;; - i) AUDIO_INTERVAL="$OPTARG" ;; - h) printf \ -"Usage: volume-pulseaudio [-S] [-F format] [-f format] [-p] [-a|-d] [-H symb] [-M symb] - [-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-i inter] [-h] -Options: --F, -f\tOutput format (-F long format, -f short format) to use, amonst: -\t0\t symb vol [index:name]\t (default long) -\t1\t symb vol [name] -\t2\t symb vol [index]\t (default short) -\t3\t symb vol --S\tSubscribe to volume events (requires persistent block, always uses long format) --p\tOmit the percent sign (%%) in volume --a\tUse ALSA name if possible --d\tUse device description instead of name if possible --H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL' --M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL' --L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL' --X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL' --T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH --t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH --C\tColor for non-muted audio. Default: $DEFAULT_COLOR --c\tColor for muted audio. Default: $MUTED_COLOR --i\tInterval size of volume increase/decrease. Default: $AUDIO_INTERVAL --h\tShow this help text -" && exit 0;; - esac -done - -function move_sinks_to_new_default { - DEFAULT_SINK=$1 - pacmd list-sink-inputs | grep index: | grep -o '[0-9]\+' | while read SINK - do - pacmd move-sink-input $SINK $DEFAULT_SINK - done -} - -function set_default_playback_device_next { - inc=${1:-1} - num_devices=$(pacmd list-sinks | grep -c index:) - sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+')) - default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 )) - default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices )) - default_sink=${sink_arr[$default_sink_index]} - pacmd set-default-sink $default_sink - move_sinks_to_new_default $default_sink -} - -case "$BLOCK_BUTTON" in - 1) set_default_playback_device_next ;; - 2) amixer -q -D pulse sset Master toggle ;; - 3) set_default_playback_device_next -1 ;; - 4) amixer -q -D pulse sset Master $AUDIO_INTERVAL%+ ;; - 5) amixer -q -D pulse sset Master $AUDIO_INTERVAL%- ;; -esac - -function print_format { - PERCENT="%" - [[ $USE_PERCENT == 0 ]] && PERCENT="" - case "$1" in - 1) echo "$SYMBOL$VOL$PERCENT [$NAME]" ;; - 2) echo "$SYMBOL$VOL$PERCENT [$INDEX]";; - 3) echo "$SYMBOL$VOL$PERCENT" ;; - *) echo "$SYMBOL$VOL$PERCENT [$INDEX:$NAME]" ;; - esac -} - -function print_block { - for name in INDEX NAME VOL MUTED; do - read $name - done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*') - INDEX=$(echo "$INDEX" | grep -o '[0-9]\+') - VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 ) - VOL="${VOL%?}" - - NAME=$(echo "$NAME" | sed \ -'s/.*<.*\.\(.*\)>.*/\1/; t;'\ -'s/.*<\(.*\)>.*/\1/; t;'\ -'s/.*/unknown/') - - if [[ $USE_ALSA_NAME == 1 ]] ; then - ALSA_NAME=$(pacmd list-sinks |\ -awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\ -grep "alsa.name\|alsa.mixer_name" |\ -head -n1 |\ -sed 's/.*= "\(.*\)".*/\1/') - NAME=${ALSA_NAME:-$NAME} - elif [[ $USE_DESCRIPTION == 1 ]] ; then - DESCRIPTION=$(pacmd list-sinks |\ -awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\ -grep "device.description" |\ -head -n1 |\ -sed 's/.*= "\(.*\)".*/\1/') - NAME=${DESCRIPTION:-$NAME} - fi - - if [[ $MUTED =~ "no" ]] ; then - SYMBOL=$AUDIO_HIGH_SYMBOL - [[ $VOL -le $AUDIO_MED_THRESH ]] && SYMBOL=$AUDIO_MED_SYMBOL - [[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMBOL=$AUDIO_LOW_SYMBOL - COLOR=$DEFAULT_COLOR - else - SYMBOL=$AUDIO_MUTED_SYMBOL - COLOR=$MUTED_COLOR - fi - - if [[ $SUBSCRIBE == 1 ]] ; then - print_format "$LONG_FORMAT" - else - print_format "$LONG_FORMAT" - print_format "$SHORT_FORMAT" - echo "$COLOR" - fi -} - -print_block -if [[ $SUBSCRIBE == 1 ]] ; then - while read -r EVENT; do - print_block - done < <(pactl subscribe | stdbuf -oL grep change) -fi diff --git a/profiles/i3/.config/i3/scripts/volume_1 b/profiles/i3/.config/i3/scripts/volume_1 deleted file mode 100755 index 9e2ac0b..0000000 --- a/profiles/i3/.config/i3/scripts/volume_1 +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Julien Bonjean -# Copyright (C) 2014 Alexander Keller - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -#------------------------------------------------------------------------ - -# The second parameter overrides the mixer selection -# For PulseAudio users, use "pulse" -# For Jack/Jack2 users, use "jackplug" -# For ALSA users, you may use "default" for your primary card -# or you may use hw:# where # is the number of the card desired -MIXER="default" -[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse" -[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" -MIXER="${2:-$MIXER}" - -# The instance option sets the control to report and configure -# This defaults to the first control of your selected mixer -# For a list of the available, use `amixer -D $Your_Mixer scontrols` -SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | -sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" | -head -n1 -)}" - -# The first parameter sets the step to change the volume by (and units to display) -# This may be in in % or dB (eg. 5% or 3dB) -STEP="${1:-5%}" - -#------------------------------------------------------------------------ - -capability() { # Return "Capture" if the device is a capture device - amixer -D $MIXER get $SCONTROL | - sed -n "s/ Capabilities:.*cvolume.*/Capture/p" -} - -volume() { - amixer -D $MIXER get $SCONTROL $(capability) -} - -format() { - perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' - perl_filter+='{CORE::say $4 eq "off" ? "0%" : "' - # If dB was selected, print that instead - perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') - perl_filter+='"; exit}' - perl -ne "$perl_filter" -} - -#------------------------------------------------------------------------ - -case $BLOCK_BUTTON in - 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute - 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase - 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease -esac - -volume | format - diff --git a/profiles/i3/.config/polybar/config.d/base_bar b/profiles/i3/.config/polybar/config.d/base_bar deleted file mode 100644 index 5ba1901..0000000 --- a/profiles/i3/.config/polybar/config.d/base_bar +++ /dev/null @@ -1,19 +0,0 @@ -[bar/base] -width=900 ;100% -height=35 -radius=6.0 -fixed-center=false -background=${colors.background} -foreground=${colors.foreground} -line-size=3 -line-color=#f00 -border-size=0 -border-color=#00000000 -padding-left=0 -padding-right=2 -module-margin-left=1 -module-margin-right=3 - -font-0 = "Noto Sans:size=14:style=Regular;1" -font-1 = unifont:fontformat=truetype:size=14:antialias=false;0 -font-2 = FontAwesome:size=14;0 \ No newline at end of file diff --git a/profiles/i3/.config/polybar/config.d/colors b/profiles/i3/.config/polybar/config.d/colors deleted file mode 100644 index b2e587f..0000000 --- a/profiles/i3/.config/polybar/config.d/colors +++ /dev/null @@ -1,11 +0,0 @@ -[colors] -background=#222 -background-alt=#444 -foreground=#dfdfdf -foreground-alt=#555 -primary=#ffb52a -secondary=#e60053 -alert=#bd2c40 -green=#689d6a -yellow=#fabc2f -red=#cc241d \ No newline at end of file diff --git a/profiles/i3/.config/polybar/config.d/modules b/profiles/i3/.config/polybar/config.d/modules deleted file mode 100644 index 06afc6a..0000000 --- a/profiles/i3/.config/polybar/config.d/modules +++ /dev/null @@ -1,416 +0,0 @@ -[module/xwindow] -type=internal/xwindow -label="> %title:0:75:...%" - - -[module/xkeyboard] -type=internal/xkeyboard -blacklist-0=num lock - -format-prefix=" " -format-prefix-foreground=${colors.foreground-alt} -format-prefix-underline=${colors.secondary} - -label-layout=%layout% -label-layout-underline=${colors.secondary} - -label-indicator-padding=2 -label-indicator-margin=1 -label-indicator-background=${colors.secondary} -label-indicator-underline=${colors.secondary} - -[module/filesystem] -type=internal/fs -interval=25 - -mount-0=/ -mount-1=/data -mount-2=/backup - -label-mounted=%{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% -label-unmounted=%mountpoint% not mounted -label-unmounted-foreground=${colors.foreground-alt} - -[module/bspwm] -type=internal/bspwm - -label-focused=%index% -label-focused-background=${colors.background-alt} -label-focused-underline=${colors.primary} -label-focused-padding=2 - -label-occupied=%index% -label-occupied-padding=2 - -label-urgent=%index%! -label-urgent-background=${colors.alert} -label-urgent-padding=2 - -label-empty=%index% -label-empty-foreground=${colors.foreground-alt} -label-empty-padding=2 - -[module/i3] -type=internal/i3 -format= -index-sort=true -wrapping-scroll=false -strip-wsnumbers=true -pin-workspaces=true - -label-mode-padding=2 -label-mode-foreground=#000 -label-mode-background=${colors.primary} - -label-focused=%icon% -label-focused-background=${colors.green} -label-focused-underline=${colors.green} -label-focused-padding=${module/bspwm.label-focused-padding} - -label-unfocused=%icon% -label-unfocused-padding=${module/bspwm.label-occupied-padding} - -label-urgent=%icon% -label-urgent-background=${colors.red} -label-urgent-underline=${colors.red} -label-urgent-padding=${module/bspwm.label-urgent-padding} - -label-visible=%icon% -label-visible-background=${self.label-focused-background} -label-visible-underline=${self.label-focused-underline} -label-visible-padding=${self.label-focused-padding} -ws-icon-0=1;1 -ws-icon-1=2;2 -ws-icon-2=3;3 -ws-icon-3=4;4 -ws-icon-4=5;5 -ws-icon-5=6;6 -ws-icon-6=7;7  -ws-icon-7=8;8  -ws-icon-8=9;9  -ws-icon-9=10;0  - -[module/mpd] -type=internal/mpd -format-online= - -icon-prev= -icon-stop= -icon-play= -icon-pause= -icon-next= - -label-song-maxlen=25 -label-song-ellipsis=true - -[module/xbacklight] -type=internal/xbacklight - -format=