Skip to content

Commit cda35c2

Browse files
committed
Remove redundant stuff, minor upgrades to work with EC2 and add github actions(Weekly CI)
1 parent 050526d commit cda35c2

File tree

19 files changed

+76
-4543
lines changed

19 files changed

+76
-4543
lines changed

.github/workflows/ubuntu.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
on:
3+
push:
4+
schedule:
5+
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4 # Checks out the current repository
12+
- name: "Install.sh"
13+
run: "bash install.sh server"

conky/conkylock

Lines changed: 0 additions & 19 deletions
This file was deleted.

conky/conkyrc

Lines changed: 0 additions & 184 deletions
This file was deleted.

i3/finance.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
urls = ["https://www.cnbc.com/quotes/%40SI.1",
5+
"https://www.cnbc.com/quotes/%40GC.1",
6+
"https://www.cnbc.com/quotes/INR="]
7+
8+
selector = "#quote-page-strip > div.QuoteStrip-dataContainer > div.QuoteStrip-lastTimeAndPriceContainer > div.QuoteStrip-lastPriceStripContainer > span.QuoteStrip-lastPrice"
9+
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'}
10+
11+
def get_price(url):
12+
response = requests.get(url, headers=headers)
13+
soup = BeautifulSoup(response.content, 'html.parser')
14+
try:
15+
price = soup.select_one(selector).get_text()
16+
except:
17+
price = 0
18+
price = price.replace(",", "")
19+
return float(price)
20+
21+
prices = [get_price(url) for url in urls]
22+
prices_sanitized = list(map(str, [int(p * 100) / 100 for p in prices]))
23+
icons = ['🥈: ', '🥇: ', '$->₹: ']
24+
final_str = ' | '.join([icons[i] + prices_sanitized[i] for i in range(len(prices))])
25+
print(final_str)

i3/py3status_config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ external_script chogadiya {
9191
cache_timeout = 1200
9292
}
9393

94+
external_script finance {
95+
format = "{output}"
96+
script_path = "python /usr/bin/finance.py"
97+
cache_timeout = 1200
98+
}
99+
94100

95101
volume_status {
96102
thresholds = [

install.sh

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
#####################################################
2-
#
3-
# Personal Environment Config
4-
#
5-
# .--.
6-
# ::\`--._,'.::.`._.--'/::
7-
# ::::. ` __::__ ' .::::
8-
# ::::::-:.`'..`'.:-::::::
9-
# ::::::::\ `--' /::::::::
10-
# '--'
11-
#
12-
# Try not.
13-
# Do or do not. There is no try.
14-
#####################################################
15-
16-
171
URL=https://github.com/ms-google/config.git
182
CONFIGDIR=$HOME/.mconfig
193

204
basic_update () {
21-
sudo apt install -y --no-install-recommends git unzip wget
5+
sudo apt install -y --no-install-recommends git unzip wget git-delta
226
if [ ! -d "$CONFIGDIR" ] ; then
237
echo "Config repo doesn't exist at $CONFIGDIR, cloning";
248

@@ -34,9 +18,6 @@ basic_update () {
3418
mv "$extracted_dir"/* "$dest_dir"
3519
rm -r "$extracted_dir"
3620
fi
37-
38-
39-
# git clone "$URL" "$CONFIGDIR";
4021
else
4122
echo "Config repo exists at $CONFIGDIR, checking for updates";
4223
cd "$CONFIGDIR";
@@ -45,49 +26,52 @@ basic_update () {
4526
}
4627

4728
dependencies_ubuntu () {
48-
# Install neovim / vim 8.0
49-
sudo apt install -y --no-install-recommends neovim vim
50-
sudo apt install -y --no-install-recommends ncdu tmux ranger w3m curl htop
29+
sudo add-apt-repository -y ppa:neovim-ppa/stable
30+
sudo apt update -y
31+
sudo apt install -y --no-install-recommends neovim vim ranger tmux
32+
sudo apt install -y --no-install-recommends ncdu wget w3m curl htop btop ripgrep bat nvtop
5133
sudo apt install -y --no-install-recommends xclip xsel
34+
35+
if which python &>/dev/null; then
36+
python -m ensurepip --upgrade
37+
python -m pip install uv
38+
uv pip install --system beautifulsoup4 black flake8 ipython isort matplotlib-inline numpy pandas requests rich ruff uploadserver uv yt-dlp
39+
else
40+
echo "Python not found, skipping command."
41+
fi
42+
5243
echo "Dependencies installed";
5344
}
5445

5546
bin_update() {
5647
sudo cp $CONFIGDIR/git/redate /usr/bin/redate && sudo chmod +x /usr/bin/redate
57-
sudo cp $CONFIGDIR/python/loadpy /usr/bin/loadpy && sudo chmod +x /usr/bin/loadpy
5848
echo "Binaries installed";
5949
}
6050

61-
config_update() {
62-
cp $CONFIGDIR/git/gitconfig $HOME/.gitconfig
63-
mkdir -p $HOME/.ipython/ && cp $CONFIGDIR/python/ipython_config $HOME/.ipython/ipython_config.py
64-
mkdir -p $HOME/.config/ranger && cp $CONFIGDIR/ranger/* $HOME/.config/ranger/
65-
echo "configs updated";
66-
}
67-
6851
zsh_update() {
69-
sudo apt install -y zsh fonts-font-awesome fzf
52+
sudo apt install -y --no-install-recommends zsh fonts-font-awesome fzf
7053
sudo chsh -s $(which zsh)
7154

7255
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
73-
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
56+
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
7457
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
7558
git clone https://github.com/zsh-users/zsh-autosuggestions.git $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions
7659

77-
mv $HOME/.zshrc $HOME/.zshrc_old
60+
if test -f $HOME/.zshrc; then
61+
mv $HOME/.zshrc $HOME/.zshrc_old
62+
fi
7863
cp $CONFIGDIR/zsh/zshrc $HOME/.zshrc && cp $CONFIGDIR/zsh/aliases $HOME/.zsh_aliases
79-
cp $CONFIGDIR/zsh/p10k.zsh $HOME/.p10k.zsh
8064

81-
sudo mkdir -p /usr/share/fonts/truetype/fonts-iosveka/
82-
sudo cp $CONFIGDIR/static/iosveka-regular.ttf /usr/share/fonts/truetype/fonts-iosveka/
65+
sudo mkdir -p /usr/share/fonts/truetype/fonts-iosevka/
66+
sudo cp $CONFIGDIR/static/iosevka-regular.ttf /usr/share/fonts/truetype/fonts-iosevka/
8367
echo "zsh updated";
8468
}
8569

8670
tmux_update() {
8771
mkdir -p $HOME/.tmux/
8872
cp tmux/tmux.conf $HOME/.tmux.conf
8973
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
90-
tmux source-file $HOME/.tmux.conf
74+
tmux new-session -d && tmux source-file $HOME/.tmux.conf
9175
echo "tmux updated";
9276
}
9377

@@ -106,6 +90,7 @@ i3_update() {
10690
sudo apt-get install -y --no-install-recommends py3status i3 i3lock rofi
10791
mkdir -p $HOME/.config/i3
10892
cp $CONFIGDIR/i3/*confg $HOME/.config/i3/
93+
cp $CONFIGDIR/i3/*.py /usr/bin/
10994
echo "i3 updated";
11095
}
11196

@@ -124,7 +109,6 @@ vim_update() {
124109
common_update() {
125110
basic_update
126111
dependencies_ubuntu
127-
config_update
128112
bin_update
129113
zsh_update
130114
vim_update

0 commit comments

Comments
 (0)