From 5db6bbeec9c4e0505e2f4fa383d2ea6cbf8fa025 Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Fri, 22 May 2020 03:01:50 +0200 Subject: [PATCH] Finished cleanup --- .gitmodules | 6 - README.md | 18 +- README.org | 100 -- config/.Xdefaults | 39 + config/.Xresources | 36 - config/.config/ranger/commands.py | 48 - config/.config/ranger/commands_full.py | 1741 ------------------------ config/.config/ranger/scope.sh | 216 --- config/.gtk-bookmarks | 1 - config/.gtkrc-2.0 | 18 - config/.local/share/ranger/bookmarks | 2 +- config/.scripts/i3lock.py | 2 +- config/.scripts/spotify-play.cpp | 93 -- config/.scripts/spotify-play.out | Bin 39648 -> 0 bytes config/.scripts/spotify-play.py | 47 - vim/.vim/.VimballRecord | 1 - vim/.vim/spell/de.utf-8.add | 1600 +++++++++++----------- vim/.vim/templates/writeup.md | 12 - 18 files changed, 852 insertions(+), 3128 deletions(-) delete mode 100644 .gitmodules delete mode 100644 README.org delete mode 100644 config/.Xresources delete mode 100644 config/.config/ranger/commands.py delete mode 100644 config/.config/ranger/commands_full.py delete mode 100755 config/.config/ranger/scope.sh delete mode 100644 config/.gtk-bookmarks delete mode 100644 config/.gtkrc-2.0 delete mode 100644 config/.scripts/spotify-play.cpp delete mode 100755 config/.scripts/spotify-play.out delete mode 100755 config/.scripts/spotify-play.py delete mode 100644 vim/.vim/.VimballRecord delete mode 100644 vim/.vim/templates/writeup.md diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c6c44e3..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "vim/.vim/pack/plugins/start/vim-go"] - path = vim/.vim/pack/plugins/start/vim-go - url = https://github.com/fatih/vim-go/ -[submodule "vim/.vim/plugin/vim/.vim/plugged/vim-polyglot"] - path = vim/.vim/plugin/vim/.vim/plugged/vim-polyglot - url = https://github.com/sheerun/vim-polyglot diff --git a/README.md b/README.md index f541adb..73af8af 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,21 @@ Main tools I am currently using are: ## Getting started -Todo (along with cleanup) +To make full use of the dotfiles we need to install the following packages via pacman: + +`pacman -Syu zsh gvim byobu conky firefox rxvt-unicode dunst highlight i3-gaps neofetch ranger rofi` + +And the following packages from the AUR: +`yay -S cava polybar` + +### zsh setup + +```sh +chsh -s /bin/zsh +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +cp -r /usr/share/zsh-theme-powerlevel9k $HOME/.oh-my-zsh/themes/powerlevel9k +rm -rf $HOME/.*bash* # optional, but removes all bash related stuff from the home directory +``` ### Font setup @@ -42,4 +56,4 @@ stow config ## License -This project is license under the GPL-3.0 License - see LICENSE file for details. +This project is licensed under the GPL-3.0 License - see LICENSE file for details. diff --git a/README.org b/README.org deleted file mode 100644 index 21026d6..0000000 --- a/README.org +++ /dev/null @@ -1,100 +0,0 @@ -* dotfiles ┐【 ̄~ ̄】┌ -These are my personal dotfiles. -I'm using: - - [[https://www.gnu.org/software/emacs/][GNU Emacs]] - - [[https://www.gnu.org/software/stow][GNU stow]] - - [[https://github.com/Airblader/i3][i3-gaps]] - - [[https://github.com/jaagr/polybar][Polybar]] - - [[https://github.com/nana-4/materia-theme][Materia Theme]] - - [[http://zsh.sourceforge.net][zsh]] - -** TODOS: - - 1) Making an own [[https://github.com/brndnmtthws/conky/wiki/Configuraion-Settings][conky]], conky_maia-like - -** Getting Started -*** Prerequisites -**** Pacman Install -***** System - - lightdm -****** Terminal - - zsh - - termite -***** Essentials - - nyancat - - stow - - git - - python-pip - - xsel - - rofi -***** Lifestyle - - emacs - - texlive-most - - evince - - scrot - - aspell-en -***** Pretty stuff (i.e. ricing, pretty cli-apps) - - cmus - - lxappearance - - conky - - arc-icon-theme -****** oh-my-zsh - - powerline-fonts - - awesome-terminal-fonts - - zsh-theme-powerlevel9k - -**** Yaourt Install -***** System - - lightdm-mini-greeter - - i3-gaps (Moved into the official Arch community repo) - - i3lock-color -***** Essentials - - polybar -***** Pretty stuff (i.e. ricing, pretty cli-apps) - - cava - - materia-theme - - neofetch -*** Setting up zsh -#+BEGIN_SRC sh -chsh -s /bin/zsh -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" # Downloading/Installing oh-my-zsh -cp -r /usr/share/zsh-theme-powerlevel9k ~/.oh-my-zsh/themes/powerlevel9k # copying powerlevel9k-theme to the desired directory -rm -rf ~/.*bash* # remove bash related files from your home directory.. don't do it if you wanna keep using bash with this user -#+END_SRC - -*** Setting up Emacs -I tried to make this as easy as possible. All packages should be installed automatically. -Config file is =.emacs.d/config.org= -*** Font setup -Stolen from [[https://github.com/powerline/fonts][here]]. -#+BEGIN_SRC sh -git clone https://github.com/powerline/fonts.git --depth=1 -# install -cd fonts -./install.sh -# clean-up a bit -cd .. -rm -rf fonts -#+END_SRC - -*** "Installing" the dotfiles. -Take a look at already existing files and delete them if necessary. -#+BEGIN_SRC sh -git clone https://github.com/TuDatTr/dotfiles .dotfiles && cd .dotfiles -stow emacs -stow zsh -stow config -sudo ln -s ~/.scripts/pipes.sh /usr/local/bin/pipes -#+END_SRC - - -* Author - - Tuan-Dat Tran - [[https://github.com/tudattr/][TuDatTr]] - -* License -This project is license under the GPL-3.0 License - see LICENSE file for details. - -* Acknowledgements - - [[https://www.reddit.com/r/unixporn/][unixporn - the home for *NIX customisation!]] - - [[https://uigradients.com][uiGradients - Beautiful colored gradients]] - - [[http://terminal.sexy/][terminal.sexy - Terminal Color Scheme Designer]] diff --git a/config/.Xdefaults b/config/.Xdefaults index 3e8c914..67c25be 100644 --- a/config/.Xdefaults +++ b/config/.Xdefaults @@ -24,3 +24,42 @@ urxvt*blurRadius: 15 ! Xft Xft.dpi: 92 Xft.antialias: 1 + +! Color +*.foreground: #98abb2 +*.background: #181b28 +*.cursorColor: #ffffff + +! black +*.color0: #161925 +*.color8: #0c0e14 + +! red +*.color1: #e84f4f +*.color9: #d23d3d + +! green +*.color2: #00ffaf +*.color10: #237885 + +! yellow +*.color3: #ffbb24 +*.color11: #f8ec09 + +! blue +*.color4: #007fff +*.color12: #00c4ff + +! magenta +*.color5: #8c00fd +*.color13: #cd00df + +! cyan +*.color6: #00e8b7 +*.color14: #00d3a7 + +! white +*.color7: #98abb2 +*.color15: #c0bfbc + + diff --git a/config/.Xresources b/config/.Xresources deleted file mode 100644 index 8634f9f..0000000 --- a/config/.Xresources +++ /dev/null @@ -1,36 +0,0 @@ -! Color -*.foreground: #98abb2 -*.background: #181b28 -*.cursorColor: #ffffff - -! black -*.color0: #161925 -*.color8: #0c0e14 - -! red -*.color1: #e84f4f -*.color9: #d23d3d - -! green -*.color2: #00ffaf -*.color10: #237885 - -! yellow -*.color3: #ffbb24 -*.color11: #f8ec09 - -! blue -*.color4: #007fff -*.color12: #00c4ff - -! magenta -*.color5: #8c00fd -*.color13: #cd00df - -! cyan -*.color6: #00e8b7 -*.color14: #00d3a7 - -! white -*.color7: #98abb2 -*.color15: #c0bfbc diff --git a/config/.config/ranger/commands.py b/config/.config/ranger/commands.py deleted file mode 100644 index eac4567..0000000 --- a/config/.config/ranger/commands.py +++ /dev/null @@ -1,48 +0,0 @@ -from __future__ import (absolute_import, division, print_function) - -import os - -from ranger.api.commands import Command - -class my_edit(Command): - # The so-called doc-string of the class will be visible in the built-in - # help that is accessible by typing "?c" inside ranger. - """:my_edit - - A sample command for demonstration purposes that opens a file in an editor. - """ - - # The execute method is called when you run this command in ranger. - def execute(self): - # self.arg(1) is the first (space-separated) argument to the function. - # This way you can write ":my_edit somefilename". - if self.arg(1): - # self.rest(1) contains self.arg(1) and everything that follows - target_filename = self.rest(1) - else: - # self.fm is a ranger.core.filemanager.FileManager object and gives - # you access to internals of ranger. - # self.fm.thisfile is a ranger.container.file.File object and is a - # reference to the currently selected file. - target_filename = self.fm.thisfile.path - - # This is a generic function to print text in ranger. - self.fm.notify("Let's edit the file " + target_filename + "!") - - # Using bad=True in fm.notify allows you to print error messages: - if not os.path.exists(target_filename): - self.fm.notify("The given file does not exist!", bad=True) - return - - # This executes a function from ranger.core.acitons, a module with a - # variety of subroutines that can help you construct commands. - # Check out the source, or run "pydoc ranger.core.actions" for a list. - self.fm.edit_file(target_filename) - - # The tab method is called when you press tab, and should return a list of - # suggestions that the user will tab through. - # tabnum is 1 for and -1 for by default - def tab(self, tabnum): - # This is a generic tab-completion function that iterates through the - # content of the current directory. - return self._tab_directory_content() diff --git a/config/.config/ranger/commands_full.py b/config/.config/ranger/commands_full.py deleted file mode 100644 index f67be14..0000000 --- a/config/.config/ranger/commands_full.py +++ /dev/null @@ -1,1741 +0,0 @@ -from __future__ import (absolute_import, division, print_function) - -from collections import deque -import os -import re - -from ranger.api.commands import Command - - -class alias(Command): - """:alias - - Copies the oldcommand as newcommand. - """ - - context = 'browser' - resolve_macros = False - - def execute(self): - if not self.arg(1) or not self.arg(2): - self.fm.notify('Syntax: alias ', bad=True) - return - - self.fm.commands.alias(self.arg(1), self.rest(2)) - - -class echo(Command): - """:echo - - Display the text in the statusbar. - """ - - def execute(self): - self.fm.notify(self.rest(1)) - - -class cd(Command): - """:cd [-r] - - The cd command changes the directory. - If the path is a file, selects that file. - The command 'cd -' is equivalent to typing ``. - Using the option "-r" will get you to the real path. - """ - - def execute(self): - if self.arg(1) == '-r': - self.shift() - destination = os.path.realpath(self.rest(1)) - if os.path.isfile(destination): - self.fm.select_file(destination) - return - else: - destination = self.rest(1) - - if not destination: - destination = '~' - - if destination == '-': - self.fm.enter_bookmark('`') - else: - self.fm.cd(destination) - - def _tab_args(self): - # dest must be rest because path could contain spaces - if self.arg(1) == '-r': - start = self.start(2) - dest = self.rest(2) - else: - start = self.start(1) - dest = self.rest(1) - - if dest: - head, tail = os.path.split(os.path.expanduser(dest)) - if head: - dest_exp = os.path.join(os.path.normpath(head), tail) - else: - dest_exp = tail - else: - dest_exp = '' - return (start, dest_exp, os.path.join(self.fm.thisdir.path, dest_exp), - dest.endswith(os.path.sep)) - - @staticmethod - def _tab_paths(dest, dest_abs, ends_with_sep): - if not dest: - try: - return next(os.walk(dest_abs))[1], dest_abs - except (OSError, StopIteration): - return [], '' - - if ends_with_sep: - try: - return [os.path.join(dest, path) for path in next(os.walk(dest_abs))[1]], '' - except (OSError, StopIteration): - return [], '' - - return None, None - - def _tab_match(self, path_user, path_file): - if self.fm.settings.cd_tab_case == 'insensitive': - path_user = path_user.lower() - path_file = path_file.lower() - elif self.fm.settings.cd_tab_case == 'smart' and path_user.islower(): - path_file = path_file.lower() - return path_file.startswith(path_user) - - def _tab_normal(self, dest, dest_abs): - dest_dir = os.path.dirname(dest) - dest_base = os.path.basename(dest) - - try: - dirnames = next(os.walk(os.path.dirname(dest_abs)))[1] - except (OSError, StopIteration): - return [], '' - - return [os.path.join(dest_dir, d) for d in dirnames if self._tab_match(dest_base, d)], '' - - def _tab_fuzzy_match(self, basepath, tokens): - """ Find directories matching tokens recursively """ - if not tokens: - tokens = [''] - paths = [basepath] - while True: - token = tokens.pop() - matches = [] - for path in paths: - try: - directories = next(os.walk(path))[1] - except (OSError, StopIteration): - continue - matches += [os.path.join(path, d) for d in directories - if self._tab_match(token, d)] - if not tokens or not matches: - return matches - paths = matches - - return None - - def _tab_fuzzy(self, dest, dest_abs): - tokens = [] - basepath = dest_abs - while True: - basepath_old = basepath - basepath, token = os.path.split(basepath) - if basepath == basepath_old: - break - if os.path.isdir(basepath_old) and not token.startswith('.'): - basepath = basepath_old - break - tokens.append(token) - - paths = self._tab_fuzzy_match(basepath, tokens) - if not os.path.isabs(dest): - paths_rel = basepath - paths = [os.path.relpath(path, paths_rel) for path in paths] - else: - paths_rel = '' - return paths, paths_rel - - def tab(self, tabnum): - from os.path import sep - - start, dest, dest_abs, ends_with_sep = self._tab_args() - - paths, paths_rel = self._tab_paths(dest, dest_abs, ends_with_sep) - if paths is None: - if self.fm.settings.cd_tab_fuzzy: - paths, paths_rel = self._tab_fuzzy(dest, dest_abs) - else: - paths, paths_rel = self._tab_normal(dest, dest_abs) - - paths.sort() - - if self.fm.settings.cd_bookmarks: - paths[0:0] = [ - os.path.relpath(v.path, paths_rel) if paths_rel else v.path - for v in self.fm.bookmarks.dct.values() for path in paths - if v.path.startswith(os.path.join(paths_rel, path) + sep) - ] - - if not paths: - return None - if len(paths) == 1: - return start + paths[0] + sep - return [start + dirname for dirname in paths] - - -class chain(Command): - """:chain ; ; ... - - Calls multiple commands at once, separated by semicolons. - """ - - def execute(self): - if not self.rest(1).strip(): - self.fm.notify('Syntax: chain ; ; ...', bad=True) - return - for command in [s.strip() for s in self.rest(1).split(";")]: - self.fm.execute_console(command) - - -class shell(Command): - escape_macros_for_shell = True - - def execute(self): - if self.arg(1) and self.arg(1)[0] == '-': - flags = self.arg(1)[1:] - command = self.rest(2) - else: - flags = '' - command = self.rest(1) - - if command: - self.fm.execute_command(command, flags=flags) - - def tab(self, tabnum): - from ranger.ext.get_executables import get_executables - if self.arg(1) and self.arg(1)[0] == '-': - command = self.rest(2) - else: - command = self.rest(1) - start = self.line[0:len(self.line) - len(command)] - - try: - position_of_last_space = command.rindex(" ") - except ValueError: - return (start + program + ' ' for program - in get_executables() if program.startswith(command)) - if position_of_last_space == len(command) - 1: - selection = self.fm.thistab.get_selection() - if len(selection) == 1: - return self.line + selection[0].shell_escaped_basename + ' ' - return self.line + '%s ' - - before_word, start_of_word = self.line.rsplit(' ', 1) - return (before_word + ' ' + file.shell_escaped_basename - for file in self.fm.thisdir.files or [] - if file.shell_escaped_basename.startswith(start_of_word)) - - -class open_with(Command): - - def execute(self): - app, flags, mode = self._get_app_flags_mode(self.rest(1)) - self.fm.execute_file( - files=[f for f in self.fm.thistab.get_selection()], - app=app, - flags=flags, - mode=mode) - - def tab(self, tabnum): - return self._tab_through_executables() - - def _get_app_flags_mode(self, string): # pylint: disable=too-many-branches,too-many-statements - """Extracts the application, flags and mode from a string. - - examples: - "mplayer f 1" => ("mplayer", "f", 1) - "atool 4" => ("atool", "", 4) - "p" => ("", "p", 0) - "" => None - """ - - app = '' - flags = '' - mode = 0 - split = string.split() - - if len(split) == 1: - part = split[0] - if self._is_app(part): - app = part - elif self._is_flags(part): - flags = part - elif self._is_mode(part): - mode = part - - elif len(split) == 2: - part0 = split[0] - part1 = split[1] - - if self._is_app(part0): - app = part0 - if self._is_flags(part1): - flags = part1 - elif self._is_mode(part1): - mode = part1 - elif self._is_flags(part0): - flags = part0 - if self._is_mode(part1): - mode = part1 - elif self._is_mode(part0): - mode = part0 - if self._is_flags(part1): - flags = part1 - - elif len(split) >= 3: - part0 = split[0] - part1 = split[1] - part2 = split[2] - - if self._is_app(part0): - app = part0 - if self._is_flags(part1): - flags = part1 - if self._is_mode(part2): - mode = part2 - elif self._is_mode(part1): - mode = part1 - if self._is_flags(part2): - flags = part2 - elif self._is_flags(part0): - flags = part0 - if self._is_mode(part1): - mode = part1 - elif self._is_mode(part0): - mode = part0 - if self._is_flags(part1): - flags = part1 - - return app, flags, int(mode) - - def _is_app(self, arg): - return not self._is_flags(arg) and not arg.isdigit() - - @staticmethod - def _is_flags(arg): - from ranger.core.runner import ALLOWED_FLAGS - return all(x in ALLOWED_FLAGS for x in arg) - - @staticmethod - def _is_mode(arg): - return all(x in '0123456789' for x in arg) - - -class set_(Command): - """:set