From 360f6f11279f7e0f4dd8ba5683373d886f9d5af2 Mon Sep 17 00:00:00 2001 From: purhan Date: Sat, 13 Feb 2021 17:56:26 +0530 Subject: [PATCH] add xrandr scripts --- .../awesome/configuration/client/keys.lua | 7 +++++ src/.config/awesome/layout/bottom-bar.lua | 2 +- src/.config/awesome/layout/top-bar.lua | 4 +-- .../awesome/module/splash-terminal.lua | 1 - src/.config/awesome/theme/theme.lua | 10 +++---- src/.config/kitty/dracula.conf | 12 +-------- src/.config/kitty/kitty.conf | 2 +- src/.config/nvim/init.vim | 1 + src/.gitconfig | 27 +++++++++++++++++++ src/.profile | 1 + src/.xprofile | 6 +++++ src/scripts/Makefile | 3 ++- src/scripts/monitor_setups/1.sh | 2 -- src/scripts/monitor_setups/2.sh | 2 -- .../laptop_left_primary_monitor_right | 2 ++ src/scripts/monitor_setups/monitor_only | 2 ++ .../primary_laptop_left_monitor_right | 2 ++ 17 files changed, 58 insertions(+), 28 deletions(-) create mode 100644 src/.gitconfig delete mode 100755 src/scripts/monitor_setups/1.sh delete mode 100755 src/scripts/monitor_setups/2.sh create mode 100755 src/scripts/monitor_setups/laptop_left_primary_monitor_right create mode 100755 src/scripts/monitor_setups/monitor_only create mode 100755 src/scripts/monitor_setups/primary_laptop_left_monitor_right diff --git a/src/.config/awesome/configuration/client/keys.lua b/src/.config/awesome/configuration/client/keys.lua index 410b01e..43b00ef 100644 --- a/src/.config/awesome/configuration/client/keys.lua +++ b/src/.config/awesome/configuration/client/keys.lua @@ -14,6 +14,13 @@ end, { end, { description = 'close', group = 'client' +}) , awful.key({modkey, 'Shift'}, 'f', function(c) + c.sticky = not c.sticky + c.ontop = not c.ontop + c:raise() +end, { + description = 'convert to sticky window', + group = 'client' }), awful.key({modkey, 'Shift'}, 'c', function(c) c:kill() end, { diff --git a/src/.config/awesome/layout/bottom-bar.lua b/src/.config/awesome/layout/bottom-bar.lua index e42731e..51493d4 100644 --- a/src/.config/awesome/layout/bottom-bar.lua +++ b/src/.config/awesome/layout/bottom-bar.lua @@ -16,7 +16,7 @@ local BottomBar = function(s, offset) x = s.geometry.x, y = s.geometry.height - panel_height, stretch = false, - bg = beautiful.primary.hue_100, + bg = "00000000", fg = beautiful.fg_normal, }) diff --git a/src/.config/awesome/layout/top-bar.lua b/src/.config/awesome/layout/top-bar.lua index 180b0ff..bba39d4 100644 --- a/src/.config/awesome/layout/top-bar.lua +++ b/src/.config/awesome/layout/top-bar.lua @@ -92,9 +92,9 @@ local TopBar = function(s, offset) -- Internet Speed wibox.widget{ create_icon('', beautiful.accent.hue_200), - net_sent.widget, - create_icon('', beautiful.accent.hue_300), net_recieved.widget, + create_icon('', beautiful.accent.hue_300), + net_sent.widget, spacing = dpi(4), layout = wibox.layout.fixed.horizontal }, diff --git a/src/.config/awesome/module/splash-terminal.lua b/src/.config/awesome/module/splash-terminal.lua index b522970..5d05d95 100644 --- a/src/.config/awesome/module/splash-terminal.lua +++ b/src/.config/awesome/module/splash-terminal.lua @@ -58,7 +58,6 @@ _G.client.connect_signal('manage', function(c) c.height = (c.screen.geometry.height / 5) * 3 c.y = c.screen.geometry.height - c.height - beautiful.border_width - dpi(16) c.floating = true - c.skip_taskbar = true c.skip_decoration = true c.ontop = true c.floating = true diff --git a/src/.config/awesome/theme/theme.lua b/src/.config/awesome/theme/theme.lua index ab60b40..4065b23 100644 --- a/src/.config/awesome/theme/theme.lua +++ b/src/.config/awesome/theme/theme.lua @@ -6,8 +6,8 @@ local dpi = require('beautiful').xresources.apply_dpi local theme = {} -- Color Scheme -theme.primary = color_schemes.gruvbox.primary -theme.accent = color_schemes.gruvbox.accent +theme.primary = color_schemes.gruvbox_material.primary +theme.accent = color_schemes.gruvbox_material.accent local awesome_overrides = function(theme) theme.dir = os.getenv('HOME') .. '/.config/awesome/theme' @@ -24,11 +24,7 @@ local awesome_overrides = function(theme) -- Taglist theme.taglist_font = theme.font theme.taglist_bg_empty = theme.primary.hue_100 - theme.taglist_bg_occupied = 'linear:0,0:0,' .. dpi(32) .. ':0,' .. - theme.primary.hue_200 .. ':0.1,' .. - theme.primary.hue_200 .. ':0.1,' .. - theme.primary.hue_100 .. ':0.9,' .. - theme.primary.hue_100 + theme.taglist_bg_occupied = theme.primary.hue_200 theme.taglist_bg_urgent = 'linear:0,0:0,' .. dpi(48) .. ':0,' .. theme.accent.hue_700 .. ':0.07,' .. theme.accent.hue_700 .. ':0.07,' .. diff --git a/src/.config/kitty/dracula.conf b/src/.config/kitty/dracula.conf index 27e9dc7..ee56ded 100644 --- a/src/.config/kitty/dracula.conf +++ b/src/.config/kitty/dracula.conf @@ -1,15 +1,5 @@ -# https://draculatheme.com/kitty -# -# Installation instructions: -# -# cp dracula.conf ~/.config/kitty/ -# echo "include dracula.conf" >> ~/.config/kitty/kitty.conf -# -# Then reload kitty for the config to take affect. -# Alternatively copy paste below directly into kitty.conf - foreground #f8f8f2 -background #282828 +background #282a36 selection_foreground #ffffff selection_background #44475a diff --git a/src/.config/kitty/kitty.conf b/src/.config/kitty/kitty.conf index 9875533..0629bea 100644 --- a/src/.config/kitty/kitty.conf +++ b/src/.config/kitty/kitty.conf @@ -1,4 +1,4 @@ -include gruvbox.conf +include gruvbox-material.conf background_opacity 0.9 font_family FiraCode Nerd Font Mono diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index b969aa3..5148440 100644 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -68,6 +68,7 @@ Plug 'severin-lemaignan/vim-minimap' Plug 'tpope/vim-surround' Plug 'morhetz/gruvbox' Plug 'sainnhe/gruvbox-material' " I switch when I feel like it :P +Plug 'dracula/vim' Plug 'mg979/vim-visual-multi' Plug 'ntpeters/vim-better-whitespace' Plug 'yuttie/comfortable-motion.vim' diff --git a/src/.gitconfig b/src/.gitconfig new file mode 100644 index 0000000..d25e77f --- /dev/null +++ b/src/.gitconfig @@ -0,0 +1,27 @@ +[user] + email = purhan01@gmail.com + name = purhan +[color] + ui = true +[color "diff-highlight"] + oldHighlight = red bold 52 + newNormal = green bold + newHighlight = green bold 22 + oldNormal = red bold +[color "diff"] + meta = 11 bold + frag = magenta bold + commit = yellow bold + old = red bold + new = green bold + whitespace = red reverse +[diff-so-fancy] + changeHunkIndicators = false + stripLeadingSymbols = false + markEmptyLines = false + rulerWidth = + useUnicodeRuler = false +; install gh-cli and login with `gh auth login` +[credential "https://github.com"] + helper = !gh auth git-credential + diff --git a/src/.profile b/src/.profile index 4d8471b..be1bdd0 100644 --- a/src/.profile +++ b/src/.profile @@ -19,6 +19,7 @@ fi # include personal scripts/bin if [ -d "$HOME/scripts/bin" ] ; then PATH="$HOME/scripts/bin:$PATH" + PATH="$HOME/scripts/monitor_setups:$PATH" fi source "$HOME/.cargo/env" diff --git a/src/.xprofile b/src/.xprofile index d8392dd..0b53920 100755 --- a/src/.xprofile +++ b/src/.xprofile @@ -11,3 +11,9 @@ xset r rate 340 50 xinput set-prop "ETPS/2 Elantech Touchpad" "libinput Natural Scrolling Enabled" 1 xinput set-prop "ETPS/2 Elantech Touchpad" "libinput Tapping Enabled" 1 +# Turn off laptop screen when monitor connected +hdmi_connected=$(xrandr | grep ' connected' | grep 'HDMI' | wc -l) +if [ "$hdmi_connected" -eq 1 ]; then + eval "~/scripts/monitor_setups/monitor_only" +fi + diff --git a/src/scripts/Makefile b/src/scripts/Makefile index ea5e56a..8ddd7f7 100644 --- a/src/scripts/Makefile +++ b/src/scripts/Makefile @@ -24,7 +24,8 @@ apt = firefox \ kitty \ zsh \ stow \ - arandr + arandr \ + gh # Packages to be installed as snaps snap = discord diff --git a/src/scripts/monitor_setups/1.sh b/src/scripts/monitor_setups/1.sh deleted file mode 100755 index d573c26..0000000 --- a/src/scripts/monitor_setups/1.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output eDP1 --mode 1280x720 --pos 0x0 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 1280x0 --rotate normal --output VIRTUAL1 --off diff --git a/src/scripts/monitor_setups/2.sh b/src/scripts/monitor_setups/2.sh deleted file mode 100755 index dcd19ff..0000000 --- a/src/scripts/monitor_setups/2.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output eDP1 --same-as HDMI1 diff --git a/src/scripts/monitor_setups/laptop_left_primary_monitor_right b/src/scripts/monitor_setups/laptop_left_primary_monitor_right new file mode 100755 index 0000000..7145a4f --- /dev/null +++ b/src/scripts/monitor_setups/laptop_left_primary_monitor_right @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP1 --mode 1366x768 --pos 0x0 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 1366x0 --rotate normal --output VIRTUAL1 --off diff --git a/src/scripts/monitor_setups/monitor_only b/src/scripts/monitor_setups/monitor_only new file mode 100755 index 0000000..92ef0a1 --- /dev/null +++ b/src/scripts/monitor_setups/monitor_only @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP1 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off diff --git a/src/scripts/monitor_setups/primary_laptop_left_monitor_right b/src/scripts/monitor_setups/primary_laptop_left_monitor_right new file mode 100755 index 0000000..4017be9 --- /dev/null +++ b/src/scripts/monitor_setups/primary_laptop_left_monitor_right @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP1 --primary --mode 1366x768 --pos 0x0 --rotate normal --output HDMI1 --mode 1920x1080 --pos 1366x0 --rotate normal --output VIRTUAL1 --off