Skip to content

Instantly share code, notes, and snippets.

View barrientosvctor's full-sized avatar

Victor barrientosvctor

View GitHub Profile
@barrientosvctor
barrientosvctor / alacritty_config_setup.py
Created April 13, 2025 02:27
This script will help you to setup the default shell used on Alacritty for either Windows or Unix machines.
from os import getenv, path, getcwd
from platform import system
available_os = ["windows", "unix"]
available_shells = [
("WSL", "Pwsh", "Powershell", "Command Prompt"), # Windows
("bash", "zsh"), # Unix
]
shell_cmd = [
@barrientosvctor
barrientosvctor / .tmux.conf
Created April 13, 2025 02:24
Tmux configuration
# Set default prefix to Ctrl+a
set -g prefix C-a
# Set default terminal to xterm
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# First window is window 1
set -g base-index 1
@barrientosvctor
barrientosvctor / vimrc
Created October 11, 2024 04:46
My vimrc
let has_lua_and_abyss = has("lua") && !empty(glob("~/projects/nvim/abyss.nvim"))
let enable_abyss = 1
set bg=dark
set number
set relativenumber
set history=1000
set ruler
set undofile
set colorcolumn=80
@barrientosvctor
barrientosvctor / main.py
Created March 24, 2024 22:46
My implementation of the classic Guess Number game in your terminal.
from random import randint
def main():
try:
print("Welcome to Guess Number game!".center(50, "-"))
print("1. Guess number with attempts count")
print("2. Guess number with limited attempts")
choose_game = int(input("Choose the game mode what you want to play: "))
print("".center(50, "="))
@barrientosvctor
barrientosvctor / script.sh
Created March 24, 2024 22:37
A brightness manager for Ubuntu-based distro Linux machines.
#!/bin/bash
read -p "Provide the brightness percentage you want to set: " PERCENTAGE
device=$(xrandr | grep " connected" | cut -f1 -d " ")
# sets the brightness to specified brightness percentage
xrandr --output $device --brightness $PERCENTAGE
echo "Brightness set to $PERCENTAGE%"
@barrientosvctor
barrientosvctor / remove_submodule.sh
Created May 17, 2023 14:17
Remove any git submodule wtih this script.
#!/bin/bash
echo "WARNING: Make sure to run the script in root directory of your project."
echo "WARNING: Before to run this script, remember to previously remove git submodules in \`/.gitmodules/\` and \`/.git/config/\` files."
echo ""
read -p "Type the git submodule path that you will remove in your project: " path
# Stage the .gitmodules file
git add .gitmodules
@barrientosvctor
barrientosvctor / shawn-half-life.omp.json
Created October 9, 2022 03:34
Half Life theme for Oh my Posh
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#ac4ef0",
"properties": {
@barrientosvctor
barrientosvctor / shawn-solarized.omp.json
Created October 9, 2022 03:34
Unofficial Solarized theme for Oh my Posh
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#002b36",
"foreground": "#859900",
"properties": {
@barrientosvctor
barrientosvctor / shawn.omp.json
Created October 9, 2022 03:32
My Oh my Posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#24ecfc",
"properties": {