summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile6
-rwxr-xr-xscripts/dmenumount7
-rwxr-xr-xscripts/dmenuumount6
-rw-r--r--scripts/ip.c32
-rwxr-xr-xscripts/mic_toggle2
-rwxr-xr-xscripts/set_theme.sh9
-rwxr-xr-xscripts/xrandrdmenu4
7 files changed, 65 insertions, 1 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
new file mode 100644
index 0000000..b275cfb
--- /dev/null
+++ b/scripts/Makefile
@@ -0,0 +1,6 @@
+include ../config.mk
+
+install:
+ cp brighter darker vol_down vol_up mute mic_toggle $(PREFIX)/bin
+clean:
+ rm $(PREFIX)/bin/{brighter,darker,vol_down,vol_up,mute,mic_toggle}
diff --git a/scripts/dmenumount b/scripts/dmenumount
new file mode 100755
index 0000000..9556063
--- /dev/null
+++ b/scripts/dmenumount
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+DEVICE=$(lsblk -o NAME -n -r -p | dmenu)
+ROOT="sudo"
+MOUNTPOINT=$(echo -e "/mnt\n/mnt2" | dmenu)
+
+$ROOT mount $DEVICE $MOUNTPOINT
diff --git a/scripts/dmenuumount b/scripts/dmenuumount
new file mode 100755
index 0000000..b921b04
--- /dev/null
+++ b/scripts/dmenuumount
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+DEVICE=$(lsblk -o NAME -n -r -p | dmenu)
+ROOT=$(sudo)
+
+$ROOT umount $DEVICE
diff --git a/scripts/ip.c b/scripts/ip.c
new file mode 100644
index 0000000..3276696
--- /dev/null
+++ b/scripts/ip.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h> /* for strncpy */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+
+int
+main()
+{
+ int fd;
+ struct ifreq ifr;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+
+ /* I want to get an IPv4 IP address */
+ ifr.ifr_addr.sa_family = AF_INET;
+ strncpy(ifr.ifr_name, "wlan0", IFNAMSIZ-1);
+
+ ioctl(fd, SIOCGIFADDR, &ifr);
+
+ close(fd);
+
+ /* display result */
+ printf("%s\n", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
+
+ return 0;
+}
diff --git a/scripts/mic_toggle b/scripts/mic_toggle
index f36e8a4..044b9d6 100755
--- a/scripts/mic_toggle
+++ b/scripts/mic_toggle
@@ -1,3 +1,3 @@
#!/bin/sh
-amixer set Capture toggle
+amixer -D pulse sset Capture toggle
notify-send "Toggled mute"
diff --git a/scripts/set_theme.sh b/scripts/set_theme.sh
new file mode 100755
index 0000000..c25883d
--- /dev/null
+++ b/scripts/set_theme.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+echo "Choose a theme:" && ls ./theme/
+read theme
+
+cp ./theme/$theme/$theme.png $HOME/.config/wallpaper.png
+cp ./theme/$theme/colors.h ./dwm-6.3
+
+echo "Done"
diff --git a/scripts/xrandrdmenu b/scripts/xrandrdmenu
new file mode 100755
index 0000000..f6a918e
--- /dev/null
+++ b/scripts/xrandrdmenu
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+OUTPUT=$(xrandr | grep " connected " | awk '{ print$1 }' | dmenu)
+CHOICE=$(echo "Change resolution\nCh