From 2a6d463ddf0eff5e3006418c7f1ce1ca438192bb Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Mon, 21 Jan 2019 21:59:01 +0100 Subject: [PATCH] Add udev rules Signed-off-by: Severin Kaderli --- README.md | 10 ++++++++-- install.sh | 7 +++++++ system/.config/compton.conf | 2 +- system/.config/polybar/config | 4 ++-- system/bin/utils.sh | 7 +++++++ system/udev/rules.d/51-gcadapter.rules | 1 + 6 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 system/udev/rules.d/51-gcadapter.rules diff --git a/README.md b/README.md index 182cc36..1d2f9ec 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The installation is pretty straightforward using a couple of installation script The list of my used arch packages are found inside the files in `packages`. The files are numbered in the order they are installed, so packages inside `packages.list` are installed first and then packages in `packages2.list` are installed. The main content of this repository can be found in the `system` folder. It -contains all configurations files, directories and script that are get symlinked +contains all configurations files, directories and scripts that mostly get symlinked by my install script. ### `.config/dconf` @@ -57,7 +57,13 @@ This file contains my [compton](https://github.com/chjj/compton) configuration. This file contains my QT4 configuration. ### `bin` -This folder contains a bunch of scripts that I use. Some of them are used by Polybar or i3 and others are used directly and some like `utils.sh` contain functions that I use in other scripts. +This folder contains a bunch of scripts that I use. Some of them are used by +Polybar or i3 and others are used directly and some like `utils.sh` contain +functions that I use in other scripts. + +### `udev` +This folder contains my custom udev rules. They are moved to +`/etc/udev/rules.d/` by my installation script. ### `.aliases` This file contains my aliases that I use on a regular basis. I also use it to replace some standard commands wiht alternatives, like using `exa` instead of `ls`. diff --git a/install.sh b/install.sh index 1c7e423..c835df6 100755 --- a/install.sh +++ b/install.sh @@ -117,3 +117,10 @@ for service in "${SYSTEMD_SERVICES[@]}" do enable_service "${service}" done + +print_header "Copy custom udev rules" +for file in $SYSTEM_DIR/udev/rules.d/*.rules +do + copy_udev_rule "${file}" +done +sudo udevadm control --reload-rules diff --git a/system/.config/compton.conf b/system/.config/compton.conf index a3a243b..26453c5 100644 --- a/system/.config/compton.conf +++ b/system/.config/compton.conf @@ -16,7 +16,7 @@ opacity-rule = [ "85:class_g = 'Termite'" ]; # Performance improvements unredir-if-possible = true; backend = "glx"; -glx-no-stencil = false; +glx-no-stencil = true; glx-copy-from-front = false; glx-swap-method = "undefined"; refresh-rate = 0; diff --git a/system/.config/polybar/config b/system/.config/polybar/config index 43ef03b..c5997ef 100644 --- a/system/.config/polybar/config +++ b/system/.config/polybar/config @@ -196,10 +196,10 @@ scroll-down = light -U 5 type = internal/network interface = wlp3s0 -format-connected = %{A1:wicd-client -n &:} %{A} +format-connected = label-connected = %essid% -format-disconnected = %{A1:wicd-client -n &:}%{A} +format-disconnected = label-disconnected = Disconnected ramp-signal-0 =  diff --git a/system/bin/utils.sh b/system/bin/utils.sh index 0569455..cef3ddc 100755 --- a/system/bin/utils.sh +++ b/system/bin/utils.sh @@ -95,4 +95,11 @@ function add_to_group() { function enable_service() { print_log "Enabling service ${YELLOW}${1}${RESET}" sudo systemctl enable "${1}" +} + +# Function to copy a udev rule to /etc/udev/rules.d/ +# USAGE: copy_udev_rules FILE +function copy_udev_rule() { + print_log "Copying ${YELLOW}$(basename "${1}")${RESET} to ${YELLOW}/etc/udev/rules.d/${RESET}" + sudo cp "${1}" "/etc/udev/rules.d/" } \ No newline at end of file diff --git a/system/udev/rules.d/51-gcadapter.rules b/system/udev/rules.d/51-gcadapter.rules new file mode 100644 index 0000000..f2fe344 --- /dev/null +++ b/system/udev/rules.d/51-gcadapter.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666" \ No newline at end of file