From 692e5fcd5d16ee3ce6e4d2c0acfed825cf9e0492 Mon Sep 17 00:00:00 2001 From: asandikci Date: Mon, 23 Oct 2023 23:13:46 +0300 Subject: [PATCH] add sublime build --- README.md | 8 +++----- install.sh | 10 +++++----- src/example/in.txt | 0 src/example/main.c | 5 +++++ src/example/out.txt | 0 src/root-config.sh | 2 +- src/sublime/gcc.sublime-build | 15 +++++++++++++++ src/user-config.sh | 8 ++++++-- 8 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 src/example/in.txt create mode 100644 src/example/main.c create mode 100644 src/example/out.txt create mode 100644 src/sublime/gcc.sublime-build diff --git a/README.md b/README.md index 01fe66a..3e2d1cf 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ wget -qO- https://raw.githubusercontent.com/asandikci/iflbot-setup/main/install. - Install Apps: VSCodium, Sublime Text, Xournal++ - Dark Theme - Panel Settings: 28px -- Auto Login for user +- Auto Login to user account +- Ready to Use C/C++ Sublime Build Files +- Sublime Build Configs for both file/terminal execution ### Compatibility - Pardus 23.0 XFCE @@ -21,10 +23,6 @@ wget -qO- https://raw.githubusercontent.com/asandikci/iflbot-setup/main/install. - GNU GPLv3+ ### TODO -- [ ] Sublime Build Configs - ---- - - [ ] Disable annoying bell sound (in each restart) - Firefox - [ ] Firefox Change MainPage diff --git a/install.sh b/install.sh index 8b3f923..b9ad191 100755 --- a/install.sh +++ b/install.sh @@ -155,16 +155,16 @@ _prechecks() { _log "MEB sertifikası indiriliyor..." verbose timeout 10 wget -qO "$temp_file" "http://sertifika.meb.gov.tr/MEB_SERTIFIKASI.cer" || (_log "Sertifikayı yüklemeye çalışırken bir hata oluştu" fatal) - echo ".cer uzantılı sertifika dosyası .crt uzantılı sertifika dosyasına dönüştürülüyor..." verbose + _log ".cer uzantılı sertifika dosyası .crt uzantılı sertifika dosyasına dönüştürülüyor..." verbose openssl x509 -inform DER -in "$temp_file" -out "$temp_file" - echo "Sertifika /usr/local/share/ca-certificates/ dizinine taşınıyor" verbose + _log "Sertifika /usr/local/share/ca-certificates/ dizinine taşınıyor" verbose sudo mv "$temp_file" "/usr/local/share/ca-certificates/MEB_SERTIFIKASI.crt" - echo "Sertifika dosyasına gerekli izinler veriliyor" verbose + _log "Sertifika dosyasına gerekli izinler veriliyor" verbose sudo chmod 644 /usr/local/share/ca-certificates/MEB_SERTIFIKASI.crt - echo "Sertifikalar yenileniyor..." verbose + _log "Sertifikalar yenileniyor..." verbose sudo update-ca-certificates _log "MEB Sertifikası başarılı bir şekilde kuruldu, Tarayıcılara manuel olarak eklemeniz gerekebilir" "done" @@ -199,7 +199,7 @@ _install() { _log "Sistemi ayarlamak için ilgili yapılandırmaları yapmak istiyor musunuz?" if _checkanswer -eq 1; then _log "Kullanıcı Yapılandırmaları (sudo gerektirmeyen) Uygulanıyor..." verbose - bash "$src_dir/user-config.sh" + bash "$src_dir/user-config.sh" "$src_dir" _log "Kullanıcı Yapılandırmaları (sudo gerektirmeyen) Uygulandı..." info sleep 1 diff --git a/src/example/in.txt b/src/example/in.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/example/main.c b/src/example/main.c new file mode 100644 index 0000000..8c6c3b3 --- /dev/null +++ b/src/example/main.c @@ -0,0 +1,5 @@ +#include + +int main(){ + printf("Hello World!"); +} \ No newline at end of file diff --git a/src/example/out.txt b/src/example/out.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/root-config.sh b/src/root-config.sh index bbea21d..96a751f 100644 --- a/src/root-config.sh +++ b/src/root-config.sh @@ -5,6 +5,6 @@ # Auto Login AUTO_LOGIN_FILE=/usr/share/lightdm/lightdm.conf.d/99-pardus-lightdm-greeter-autologin.conf -sudo mv "$1/confi/lightdm-autologin" $AUTO_LOGIN_FILE +sudo mv "$1/config/lightdm-autologin" $AUTO_LOGIN_FILE user=$([ -n "$SUDO_USER" ] && echo "$SUDO_USER" || echo "$USER") sudo sed -i -e "s/autologin-user=.*/autologin-user=${user}/" $AUTO_LOGIN_FILE \ No newline at end of file diff --git a/src/sublime/gcc.sublime-build b/src/sublime/gcc.sublime-build new file mode 100644 index 0000000..c519e7d --- /dev/null +++ b/src/sublime/gcc.sublime-build @@ -0,0 +1,15 @@ +{ + "shell_cmd": "gcc -fsanitize=address -fsanitize=undefined -Wall -Wshadow \"${file}\" -o \"${file_path}/${file_base_name}\" && echo Complied && time timeout 5 \"${file_path}/${file_base_name}\" out.txt || echo -e \"!!! Kodun çalışma Süresi 5 Saniyeyi Aştı !!!\"", + "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", + "working_dir": "${file_path}", + "selector": "source.c", + "variants": + [ + { + "name": "Run in Terminal", + "linux": { + "shell_cmd": "gcc -fsanitize=address -fsanitize=undefined -Wall -Wshadow \"${file}\" -o \"${file_path}/${file_base_name}\" && echo Complied && time xfce4-terminal -e \"bash -c '\"${file_path}/${file_base_name}\" && echo && echo Press ENTER to continue && read line && exit'\"" + }, + }, + ] +} diff --git a/src/user-config.sh b/src/user-config.sh index bfa4d90..b557dd3 100644 --- a/src/user-config.sh +++ b/src/user-config.sh @@ -11,6 +11,10 @@ xfconf-query -c "xsettings" -p "/Net/IconThemeName" -s "pardus-xfce-dark" --type # Panel Size xfconf-query --channel 'xfce4-panel' --property '/panels/panel-1/size' --type int --set 28 --create +### SUBLIME BUILDS +user=$([ -n "$SUDO_USER" ] && echo "$SUDO_USER" || echo "$USER") +SUBLIME_CONFIG_FILE="/home/${user}/.config/sublime-text/Packages/User/" +sudo cp "$1/sublime/gcc.sublime-build" "$SUBLIME_CONFIG_FILE" - -### SUBLIME BUILDS \ No newline at end of file +### Desktop Files +mv "$1/example/" "/home/${user}/Masaüstü/'C Kodları'/" \ No newline at end of file