Diversos canvis de configuració
This commit is contained in:
@@ -49,6 +49,9 @@ function setup-python
|
||||
pip install autopep8 flake8 isort ipython pdbpp pip-tools pynvim
|
||||
end
|
||||
|
||||
# vterm
|
||||
. ~/.config/fish/vterm.fish
|
||||
|
||||
#########################
|
||||
# THEME #
|
||||
#########################
|
||||
@@ -63,3 +66,4 @@ set -x VIRTUAL_ENV_DISABLE_PROMPT 1
|
||||
set -x PGHOST localhost
|
||||
set -x PYENV_ROOT "$HOME/.pyenv"
|
||||
set -x PATH "$PYENV_ROOT/bin" $PATH
|
||||
set -x PATH "/home/marc/.emacs.d/bin" $PATH
|
||||
|
||||
@@ -17,7 +17,7 @@ set $mod Mod4
|
||||
|
||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||
font pango:DejaVu Sans Mono 8
|
||||
font pango:DejaVu Sans Mono 12
|
||||
|
||||
# Before i3 v4.8, we used to recommend this one as the default:
|
||||
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
@@ -34,9 +34,9 @@ new_float normal
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
set $terminal termite
|
||||
set $terminal termite -e fish
|
||||
bindsym $mod+Return exec $terminal
|
||||
bindsym $mod+Shift+Return split v;exec $terminal
|
||||
bindsym $mod+Shift+Return exec cool-retro-term
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+q kill
|
||||
@@ -155,8 +155,9 @@ bindsym $mod+Control+Right move workspace to output right
|
||||
#################### WALLPAPER ########################
|
||||
###################################################################################################
|
||||
|
||||
exec_always --no-startup-id ~/.config/i3/scripts/wallpapers.sh
|
||||
exec_always --no-startup-id compton
|
||||
# exec_always --no-startup-id ~/.config/i3/scripts/wallpapers.sh
|
||||
exec_always --no-startup-id ~/.config/i3/scripts/shuffle.sh
|
||||
# exec_always --no-startup-id compton
|
||||
|
||||
###################################################################################################
|
||||
#################### PROGRAMS ########################
|
||||
@@ -164,13 +165,11 @@ exec_always --no-startup-id compton
|
||||
|
||||
# Launch programs
|
||||
|
||||
bindsym $mod+Control+1 exec slack
|
||||
bindsym $mod+Control+3 exec firefox
|
||||
bindsym $mod+Control+3 exec brave
|
||||
bindsym $mod+Control+0 exec spotify
|
||||
|
||||
# Assign workspaces
|
||||
assign [class="Slack"] $ws1
|
||||
assign [class="Firefox"] $ws3
|
||||
assign [class="Brave"] $ws3
|
||||
for_window [class="Spotify"] move to workspace $ws10
|
||||
|
||||
# reload the configuration file
|
||||
@@ -221,33 +220,33 @@ mode "resize" {
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Autostart applications
|
||||
## Autostart applications
|
||||
exec_always --no-startup-id xmodmap $HOME/.config/Xmodmap
|
||||
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
|
||||
exec --no-startup-id ibus-daemon -d -r
|
||||
# Touchpad controls
|
||||
exec xinput set-prop "DELL07E6:00 06CB:76AF Touchpad" "libinput Tapping Enabled" 1
|
||||
exec libinput-gestures-setup start
|
||||
|
||||
# Pulse Audio controls
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% #increase sound volume
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% #decrease sound volume
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound
|
||||
|
||||
# Sreen brightness controls
|
||||
bindsym XF86MonBrightnessUp exec "$HOME/.config/i3/scripts/brightness.sh + eDP-1"
|
||||
bindsym XF86MonBrightnessDown exec "$HOME/.config/i3/scripts/brightness.sh - eDP-1"
|
||||
|
||||
# Touchpad controls
|
||||
# bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
|
||||
# Tap touchpad to click
|
||||
# exec xinput set-prop 12 276 1
|
||||
|
||||
# Toggle displays
|
||||
bindsym $mod+p exec --no-startup-id ~/.config/i3/scripts/swap_monitors.sh
|
||||
|
||||
# Media player controls
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioPause exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
|
||||
# Sreen brightness controls
|
||||
bindsym XF86MonBrightnessUp exec "$HOME/.config/i3/scripts/brightness.sh + eDP1"
|
||||
bindsym XF86MonBrightnessDown exec "$HOME/.config/i3/scripts/brightness.sh - eDP1"
|
||||
|
||||
# Toggle displays
|
||||
# bindsym $mod+p exec --no-startup-id ~/.config/i3/scripts/swap_monitors.sh
|
||||
bindsym $mod+p exec --no-startup-id rofi-pass
|
||||
|
||||
# Keyboard layout
|
||||
bindsym $mod+Shift+i exec ~/.config/polybar/scripts/ibus_select.py
|
||||
bindsym $mod+Shift+Home exec setxkbmap -layout es -variant cat & ibus engine xkb:es:cat:cat
|
||||
@@ -258,6 +257,6 @@ bindsym $mod+Shift+w exec ~/.config/polybar/scripts/wifi_connect.py
|
||||
# Other cool stuff
|
||||
bindsym $mod+Shift+t exec ~/.config/i3/scripts/tunes.sh
|
||||
|
||||
# Order of screens
|
||||
exec --no-startup-id xrandr --output DP-2 --right-of eDP-1
|
||||
exec --no-startup-id xrandr --output DP-1 --right-of DP-2
|
||||
# # Order of screens
|
||||
# exec --no-startup-id xrandr --output DP-2 --right-of eDP-1
|
||||
# exec --no-startup-id xrandr --output DP-1 --right-of DP-2
|
||||
|
||||
@@ -13,6 +13,6 @@ while true
|
||||
do
|
||||
# python /home/marc/Pictures/Pixel/render.py
|
||||
# feh --bg-center /home/marc/Pictures/Pixel/rendered.bmp
|
||||
feh --randomize --bg-fill ~/Pictures/Island/extra/*.jpg
|
||||
feh --randomize --bg-fill ~/nextcloud/Imatges/Island/extra/*.jpg
|
||||
sleep 5m
|
||||
done
|
||||
|
||||
@@ -40,7 +40,7 @@ monitor-strict = false
|
||||
bottom = false
|
||||
fixed-center = true
|
||||
width = 100%
|
||||
height = 20
|
||||
height = 30
|
||||
;offset-x = 1%
|
||||
;offset-y = 1%
|
||||
|
||||
@@ -68,11 +68,11 @@ module-margin-left = 0
|
||||
module-margin-right = 0
|
||||
|
||||
;https://github.com/jaagr/polybar/wiki/Fonts
|
||||
font-0 = "UbuntuMono Nerd Font Mono:style=Regular:size=10;2"
|
||||
font-1 = "UbuntuMono Nerd Font:size=16;3"
|
||||
font-2 = "Font Awesome 5 Free:style=Regular:pixelsize=8;1"
|
||||
font-3 = "Font Awesome 5 Free:style=Solid:pixelsize=8;1"
|
||||
font-4 = "Font Awesome 5 Brands:pixelsize=8;1"
|
||||
font-0 = "Iosevka:style=Regular:size=15;2"
|
||||
font-1 = "Iosevka:size=16;3"
|
||||
font-2 = "Iosevka:style=Regular:pixelsize=10;1"
|
||||
font-3 = "Iosevka:style=Solid:pixelsize=10;1"
|
||||
font-4 = "Iosevka:pixelsize=10;1"
|
||||
|
||||
modules-left = i3 spotify1
|
||||
modules-center = date
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
APListItem = namedtuple('APListItem', ('active', 'ssid', 'mode', 'channel', 'rate', 'signal', 'bars', 'security'))
|
||||
APListItem = namedtuple('APListItem', ('active', 'bssid', 'ssid', 'mode', 'channel', 'rate', 'signal', 'bars',
|
||||
'security'))
|
||||
ConListItem = namedtuple('ConListItem', ('name', 'uuid', 'type', 'device'))
|
||||
|
||||
def build_ap_items(output):
|
||||
return map(lambda line: APListItem(*map(lambda entry: entry.replace('\\:', ':'), line)),
|
||||
map(lambda line: re.split(r'(?<!\\):', line),
|
||||
filter(None, output.split('\n'))))
|
||||
|
||||
def build_con_items(output):
|
||||
return map(lambda line: ConListItem(*map(lambda entry: entry.replace('\\:', ':'), line)),
|
||||
map(lambda line: re.split(r'(?<!\\):', line),
|
||||
filter(None, output.split('\n'))))
|
||||
|
||||
|
||||
# ---------- ACTIONS ----------
|
||||
Action = namedtuple('Action', ('action', 'item'))
|
||||
|
||||
@@ -32,6 +45,7 @@ def format_action(action):
|
||||
if action.action == ACT_DISCONNECT_WLAN:
|
||||
return '[dis] ' + WLAN_ITEM_FORMAT.format(bars=item.bars, signal=item.signal, ssid=item.ssid, rate=item.rate)
|
||||
|
||||
|
||||
def get_command(action):
|
||||
item = action.item
|
||||
if action.action == ACT_CONNECT_VPN:
|
||||
@@ -43,23 +57,21 @@ def get_command(action):
|
||||
if action.action == ACT_DISCONNECT_WLAN:
|
||||
return ['nmcli', 'connection', 'down', item.ssid], None
|
||||
|
||||
|
||||
# ---------- BEGINNING OF SCRIPT ----------
|
||||
|
||||
|
||||
# Get available wifi APs with nmcli
|
||||
list_aps_command = ['nmcli', '-t', 'device', 'wifi', 'list']
|
||||
list_aps_result = subprocess.run(list_aps_command, stdout=subprocess.PIPE)
|
||||
list_aps_output = list_aps_result.stdout.decode('utf-8')
|
||||
try:
|
||||
nm_items = [APListItem(*line.split(':')) for line in list_aps_output.split('\n') if line]
|
||||
except Exception:
|
||||
print([line.split(':') for line in list_aps_output.split('\n') if line])
|
||||
raise
|
||||
nm_items = list(build_ap_items(list_aps_output))
|
||||
|
||||
# Get VPN status
|
||||
list_con_command = ['nmcli', '-t', 'connection', 'show']
|
||||
list_con_result = subprocess.run(list_con_command, stdout=subprocess.PIPE)
|
||||
list_con_output = list_con_result.stdout.decode('utf-8')
|
||||
con_items = [ConListItem(*line.split(':')) for line in list_con_output.split('\n') if line]
|
||||
con_items = list(build_con_items(list_con_output))
|
||||
|
||||
available_vpns = [item for item in con_items if item.type == 'vpn' and item.device.strip() == '']
|
||||
active_vpns = [item for item in con_items if item.type == 'vpn' and item.device.strip() != '']
|
||||
@@ -115,4 +127,3 @@ if connect_result.returncode == 10:
|
||||
connect_result = subprocess.run(fallback_command)
|
||||
|
||||
exit(connect_result.returncode)
|
||||
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import time
|
||||
import re
|
||||
import subprocess
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
APListItem = namedtuple('APListItem', ('active', 'ssid', 'mode', 'channel', 'rate', 'signal', 'bars', 'security'))
|
||||
APListItem = namedtuple('APListItem', ('active', 'bssid', 'ssid', 'mode', 'channel', 'rate', 'signal', 'bars',
|
||||
'security'))
|
||||
ConListItem = namedtuple('ConListItem', ('name', 'uuid', 'type', 'device'))
|
||||
|
||||
|
||||
def build_ap_items(output):
|
||||
return map(lambda line: APListItem(*map(lambda entry: entry.replace('\\:', ':'), line)),
|
||||
map(lambda line: re.split(r'(?<!\\):', line),
|
||||
filter(None, output.split('\n'))))
|
||||
|
||||
def build_con_items(output):
|
||||
return map(lambda line: ConListItem(*map(lambda entry: entry.replace('\\:', ':'), line)),
|
||||
map(lambda line: re.split(r'(?<!\\):', line),
|
||||
filter(None, output.split('\n'))))
|
||||
|
||||
|
||||
if True:
|
||||
# Get available wifi APs with nmcli
|
||||
list_aps_command = ['nmcli', '-t', 'device', 'wifi', 'list']
|
||||
list_aps_result = subprocess.run(list_aps_command, stdout=subprocess.PIPE)
|
||||
list_aps_output = list_aps_result.stdout.decode('utf-8')
|
||||
nm_items = [APListItem(*line.split(':')) for line in list_aps_output.split('\n') if line]
|
||||
nm_items = list(build_ap_items(list_aps_output))
|
||||
|
||||
active_items = [item for item in nm_items if item.active == '*']
|
||||
|
||||
|
||||
# Get VPN status
|
||||
# # Get VPN status
|
||||
list_con_command = ['nmcli', '-t', 'connection', 'show']
|
||||
list_con_result = subprocess.run(list_con_command, stdout=subprocess.PIPE)
|
||||
list_con_output = list_con_result.stdout.decode('utf-8')
|
||||
con_items = [ConListItem(*line.split(':')) for line in list_con_output.split('\n') if line]
|
||||
con_items = list(build_con_items(list_con_output))
|
||||
|
||||
active_vpn = [item for item in con_items if item.type == 'vpn' and item.device.strip() != '']
|
||||
|
||||
@@ -34,6 +45,4 @@ if True:
|
||||
wifi_status = 'disconnected'
|
||||
|
||||
vps_status = '[VPN]' if active_vpn else ''
|
||||
|
||||
print(''.join([wifi_status, vps_status]).strip())
|
||||
# time.sleep(3)
|
||||
|
||||
14
.gitconfig
14
.gitconfig
@@ -1,18 +1,16 @@
|
||||
[user]
|
||||
name = Marc Sastre Rienitz
|
||||
email = marc.sastre@vilynx.com
|
||||
|
||||
[alias]
|
||||
lgb = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches
|
||||
|
||||
om = origin/master
|
||||
od = origin/develop
|
||||
name = L'Ajuntament
|
||||
email = git@lajuntament.space
|
||||
|
||||
[core]
|
||||
editor = nvim
|
||||
excludesfile = ~/.gitignore
|
||||
|
||||
[filter "lfs"]
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
# JetBrains IDE
|
||||
# JetBrains IDE
|
||||
/.idea/
|
||||
|
||||
# Python distribution
|
||||
@@ -18,5 +18,4 @@
|
||||
|
||||
# CUSTOM FILES
|
||||
# API tester passwords
|
||||
api_tester_passwords.json
|
||||
.env*
|
||||
.dotfiles.git
|
||||
|
||||
Reference in New Issue
Block a user