aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-16 10:21:18 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-16 10:21:18 +0200
commitfb6d9a33c8a7b10557f7119865877f648d8f05da (patch)
tree07dc2afefdea417667c2bb8f059a6a3167f19be6
parente1f86f92ffcba791739dfea105cb5d8e9081db5e (diff)
parentcb9e981c80476a7297ecd7c80ba9cd8eafe0f0d1 (diff)
downloaddotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.gz
dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.bz2
dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.zip
Merge branch 'master' into carbon
-rw-r--r--.muttrc18
-rw-r--r--.vimrc2
-rwxr-xr-x.xinitrc2
-rw-r--r--.zsh_aliases27
-rw-r--r--.zshrc3
-rwxr-xr-xbin/tag-music48
-rwxr-xr-xbin/touchpad-toggle9
-rwxr-xr-xinstall1
-rw-r--r--xmonad.hs21
9 files changed, 113 insertions, 18 deletions
diff --git a/.muttrc b/.muttrc
index 9393baf..4d5e9c1 100644
--- a/.muttrc
+++ b/.muttrc
@@ -18,7 +18,7 @@ set record = "+Send"
set trash = "+Trash"
set postponed = "+Drafts"
-mailboxes =INBOX =Sent =Trash =Drafts
+mailboxes =INBOX =Sent =Send =Trash =Drafts
set editor = 'vim'
set sort = 'reverse-date' # newest at the top
@@ -27,14 +27,14 @@ set date_format = "%d/%m %I:%M"
set index_format = "%2C %Z %d %-15.15F %s (%-4.4c)" # one line format in home
# from https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc
-set rfc2047_parameters = yes # decode non standard stuff
-set sleep_time = 0 # don't pause
-set markers = no # no '+' on line wrap
-set mark_old = no # don't mark mail as read if not seen
-set mime_forward = yes # attachements forwarded
-set wait_key = no # no press to continue...
-set forward_format = "Fwd: %s" # forward subject
-set forward_quote # include previous message in forward
+set rfc2047_parameters = yes # decode non standard stuff
+set sleep_time = 0 # don't pause
+set markers = no # no '+' on line wrap
+set mark_old = no # don't mark mail as read if not seen
+set mime_forward = yes # attachements forwarded
+set wait_key = no # no press to continue...
+set forward_format = "Fwd: %s" # forward subject
+set forward_quote # include previous message in forward
set sidebar_visible = yes
set sidebar_width = 20
diff --git a/.vimrc b/.vimrc
index 27f9bdd..76dd3e9 100644
--- a/.vimrc
+++ b/.vimrc
@@ -29,7 +29,7 @@ set wrapmargin=0 " disable auto line wrapping
set encoding=utf-8 " utf-8 encoding
set formatoptions-=t " do not auto break line > 89 character
filetype plugin indent on " allow to add specific rules for certain type of file
-set mouse=a " mouse scrolling (heretic)
+" set mouse=a " mouse scrolling (heretic)
" }}}
" browse list with tab {{{
diff --git a/.xinitrc b/.xinitrc
index abb4622..fd3a72a 100755
--- a/.xinitrc
+++ b/.xinitrc
@@ -1,4 +1,4 @@
-xinput disable 'ETPS/2 Elantech Touchpad' &
+# xinput disable 'ETPS/2 Elantech Touchpad' &
redshift -c /home/charles/.config/redshift.conf &
dunst &
exec xmonad
diff --git a/.zsh_aliases b/.zsh_aliases
index f72b556..1d541dc 100644
--- a/.zsh_aliases
+++ b/.zsh_aliases
@@ -10,8 +10,8 @@ alias valgrindc='colour-valgrind'
# common commands
alias less='less -N' # enable line number
-alias v='nvim'
-alias vim='nvim'
+alias v='vim'
+# alias vim='nvim'
# alias mkdir='mkdir -p'
alias gdb='gdb -q' # disable long intro message
alias sudo='sudo ' # enable color (the search for aliases continues)
@@ -32,7 +32,7 @@ alias ta='tree -a'
alias t1='tree -L 1'
alias t2='tree -L 2'
alias t3='tree -L 3'
-alias treeI="tree -I '__pycache__' -I '*.o' -I vendor"
+# alias ti="tree | grep -v -E '*.pyc'"
# man
alias ma="man"
@@ -56,8 +56,8 @@ alias gd='git diff'
alias gds='git diff --staged'
alias gdt='git diff --stat'
alias gl='git pull'
-alias glg='git log --stat'
-alias glgg='git log --graph'
+alias glg='git log --abbrev-commit --stat'
+alias glgg='git log --abbrev-commit --graph'
alias glgo='git log --oneline --no-decorate'
alias gp='git push'
alias gcl='git clone --recurse-submodules'
@@ -67,9 +67,13 @@ alias gss='git status --short'
alias gco='git checkout'
alias gsta='git stash push'
alias gstp='git stash pop'
-alias gpa="git remote | xargs -L1 git push --all"
alias grv="git remote -v"
alias gra="git remote add"
+gpa() {
+ branch="$1"
+ [ -z "$1" ] && branch=master
+ git remote | xargs -I{} git push {} "$branch"
+}
# lpass (lastpass-cli)
alias lpassp='lpass show --password --clip' # put password in clipboard
@@ -118,9 +122,18 @@ wificonnect() {
# alias mutt='neomutt'
-alias ytdl='youtube-dl'
+alias ytdl='youtube-dl --output "%(title)s.%(ext)s"'
+alias ytdlp='youtube-dl -i --output "%(playlist_index)s-%(title)s.%(ext)s"'
alias ytdla='youtube-dl -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"'
alias qmvdest='qmv --format=do'
alias xclip='xclip -selection clipboard'
+
+pacman-url() {
+ pacman -Si "$1" | grep URL | tr -s ' ' | cut -d ' ' -f 3
+}
+
+grep-kill() {
+ ps aux | grep "$1" | tr -s ' ' | cut -d ' ' -f 2 | xargs kill
+}
diff --git a/.zshrc b/.zshrc
index 8cf539c..cc6bd78 100644
--- a/.zshrc
+++ b/.zshrc
@@ -106,3 +106,6 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:$DOTDIR/bin"
# export PATH="$PATH:$HOME/.vim/plugged/vim-superman/bin"
export GPG_TTY=$(tty) # fixing gpg fatal error about tty
+
+export MINISHELL_TEST_BONUS=yes
+export MINISHELL_TEST_PAGER=vim
diff --git a/bin/tag-music b/bin/tag-music
new file mode 100755
index 0000000..17d6aac
--- /dev/null
+++ b/bin/tag-music
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+music_dir="$HOME/Music"
+
+for artist_dir in "$music_dir"/*
+do
+ [ ! -d "$artist_dir" ] && continue
+ artist="$(basename "$artist_dir")"
+ [ "$artist" = backup ] && continue
+
+ for album_dir in "$artist_dir"/*
+ do
+ album="$(basename "$album_dir")"
+ [ ! -d "$album_dir" ] && continue
+
+ for song_file in "$album_dir"/*
+ do
+ [ ! -f "$song_file" ] && continue
+ song="$(basename "$song_file" | cut -d '.' -f 1)"
+ # echo "$artist"
+ # echo "$album"
+ # echo "$song"
+ case "$song_file" in
+ *.ogg)
+ ;;
+ *.opus)
+ echo "OPUS: $song_file"
+ echo "Title=$song
+Artist=$artist
+Album=$album
+Track=
+Total=
+Date=
+Genre=
+Comment=" | opustags -i -S "$song_file"
+ ;;
+ *.mp3)
+ id3tag --artist "$artist" --album "$album" --song "$song" "$songfile"
+ ;;
+ *.m4a)
+ id3tag --artist "$artist" --album "$album" --song "$song" "$songfile"
+ ;;
+ *)
+ ;;
+ esac
+ done
+ done
+done
diff --git a/bin/touchpad-toggle b/bin/touchpad-toggle
new file mode 100755
index 0000000..f0a86a1
--- /dev/null
+++ b/bin/touchpad-toggle
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+touchpad_name='ETPS/2 Elantech Touchpad'
+
+active="$(xinput list-props "$touchpad_name" | grep 'Device Enabled' | cut -f 3)"
+
+[ "$active" -eq 1 ] &&
+ xinput disable "$touchpad_name" ||
+ xinput enable "$touchpad_name"
diff --git a/install b/install
index 9106ed2..013b9bb 100755
--- a/install
+++ b/install
@@ -44,6 +44,7 @@ create_dotfile_link dunst/dunstrc .config/dunst/dunstrc
mkdir -p "$HOME/.newsboat"
create_dotfile_link_same .newsboat/config
+#create_dotfile_link_same .newsboat/urls
# create_dotfile_link_same slock/config.def.h
diff --git a/xmonad.hs b/xmonad.hs
index 9a1ef95..1a4b0c8 100644
--- a/xmonad.hs
+++ b/xmonad.hs
@@ -1,9 +1,15 @@
+import Control.Monad
+import Data.List
+import System.Exit
+
+
import XMonad
import XMonad.Config.Desktop
-- Utilities
import XMonad.Util.EZConfig (additionalKeysP, additionalKeys)
import XMonad.Util.SpawnOnce
+import XMonad.Util.Dmenu
-- Layouts
import XMonad.Layout.NoBorders
@@ -39,8 +45,23 @@ myKeys = [ ("<XF86AudioRaiseVolume>", spawn "~/bin/volume-ctl up")
, ("<XF86MonBrightnessUp>", spawn "~/bin/backlight-ctl up")
, ("<XF86MonBrightnessDown>", spawn "~/bin/backlight-ctl down")
, ("<XF86ScreenSaver>", spawn "slock")
+ , ("<XF86TouchpadToggle>", spawn "~/bin/touchpad-toggle")
, ("M-o", spawn "~/bin/project-open")
, ("M-m", spawn "st -e mocp")
, ("M-S-d", spawn "notify-send \"$(date +\"%H:%M %A %d/%m/%Y %B\")\"")
+ , ("M-q", spawn "notify-send Restart" >> spawn restartCmd)
+ , ("M-S-q", confirm "Are you sure you want to shutdown?" $ io (exitWith ExitSuccess))
]
+
+confirm :: String -> X () -> X ()
+confirm prompt f = do
+ result <- menuArgs "dmenu" ["-p", prompt] ["yes", "no"]
+ when (result == "yes") f
+
+restartCmd :: String
+restartCmd = intercalate "; " [ "if type xmonad"
+ , "then xmonad --recompile && xmonad --restart"
+ , "else xmessage xmonad not in \\$PATH: \"$PATH\""
+ , "fi"
+ ]